From cb0baf0bf0b2c8c830c239c1566ca7a2fcacced9 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Mon, 19 Oct 2020 14:00:11 -0700 Subject: [PATCH] integrate all shadows --- Effects/FXB/DeferredPBR_PointLightEffect.fxb | 2 +- Effects/HLSL/Shadow.fxh | 3 +-- README.md | 2 +- Renderer.cs | 6 +++--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Effects/FXB/DeferredPBR_PointLightEffect.fxb b/Effects/FXB/DeferredPBR_PointLightEffect.fxb index 330086e..9511784 100644 --- a/Effects/FXB/DeferredPBR_PointLightEffect.fxb +++ b/Effects/FXB/DeferredPBR_PointLightEffect.fxb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0331c52bcbc31d3639743c487ff1b48e6e90c5c4f9134f6b2154736a9dd8d6d0 +oid sha256:033598dc2f22c2766a8b0d46215e5a9764b5445a520d67bc68f1566dbdd15035 size 3740 diff --git a/Effects/HLSL/Shadow.fxh b/Effects/HLSL/Shadow.fxh index c1bb9ba..5f8351f 100644 --- a/Effects/HLSL/Shadow.fxh +++ b/Effects/HLSL/Shadow.fxh @@ -137,6 +137,5 @@ float HardPointShadow( float bias = max(0.05 * (1.0 - dot(N, L)), 0.005); - return (currentDepth - bias > closestDepth ? 0.25 : 1.0); - //return closestDepth / farPlane; + return (currentDepth - bias > closestDepth ? 0 : 1.0); } diff --git a/README.md b/README.md index 9cfb2c3..29c7615 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Essential - [x] Tone map shader - [x] Poisson soft shadowing - [ ] Frustum culling -- [ ] Shadow-casting point lights +- [x] Shadow-casting point lights - [ ] Parabolic lights - [x] Skyboxes - [ ] Screen-space reflection diff --git a/Renderer.cs b/Renderer.cs index 67372c8..3eb2440 100644 --- a/Renderer.cs +++ b/Renderer.cs @@ -227,7 +227,7 @@ namespace Kav { PointLightRender(camera, modelTransforms, pointLight); } - //DirectionalLightToonRender(camera, modelTransforms, directionalLight); + DirectionalLightToonRender(camera, modelTransforms, directionalLight); SkyboxRender(camera, skybox); GraphicsDevice.SetRenderTarget(null); @@ -276,7 +276,7 @@ namespace Kav TextureCube skybox ) { GraphicsDevice.RasterizerState.CullMode = CullMode.CullClockwiseFace; - SkyboxEffect.Skybox = PointShadowCubeMap; + SkyboxEffect.Skybox = skybox; var view = camera.View; view.Translation = Vector3.Zero; @@ -459,7 +459,7 @@ namespace Kav Deferred_ToonEffect.GNormal = gNormal; Deferred_ToonEffect.GMetallicRoughness = gMetallicRoughness; - Deferred_ToonEffect.DitheredShadows = true; + Deferred_ToonEffect.DitheredShadows = false; Deferred_ToonEffect.EyePosition = camera.Position; Deferred_ToonEffect.DirectionalLightDirection = directionalLight.Direction;