diff --git a/Effects/FXB/DeferredPBR_DirectionalLightEffect.fxb b/Effects/FXB/DeferredPBR_DirectionalLightEffect.fxb index adbc9a7..d3bd6a2 100644 Binary files a/Effects/FXB/DeferredPBR_DirectionalLightEffect.fxb and b/Effects/FXB/DeferredPBR_DirectionalLightEffect.fxb differ diff --git a/Effects/HLSL/DeferredPBR_DirectionalLightEffect.fx b/Effects/HLSL/DeferredPBR_DirectionalLightEffect.fx index 06f3a6b..0982521 100644 --- a/Effects/HLSL/DeferredPBR_DirectionalLightEffect.fx +++ b/Effects/HLSL/DeferredPBR_DirectionalLightEffect.fx @@ -94,9 +94,9 @@ float PoissonCoord(sampler shadowMap, float3 worldPosition, float2 texCoord, flo { int index = int(16.0 * random(floor(worldPosition * 1000.0), i)) % 16; - if (tex2D(shadowMap, texCoord + poissonDisk[i] / 700.0).r < fragmentDepth - bias) + if (tex2D(shadowMap, texCoord + poissonDisk[index] / 1024.0).r < fragmentDepth - bias) { - visibility -= 0.2; + visibility -= 0.05; } } diff --git a/Renderer.cs b/Renderer.cs index 37eead5..0a77713 100644 --- a/Renderer.cs +++ b/Renderer.cs @@ -135,7 +135,7 @@ namespace Kav DeferredDirectionalLightEffect = new DeferredPBR_DirectionalLightEffect(GraphicsDevice); DeferredDirectionalLightEffect.ShadowMapSize = ShadowMapSize; - + FullscreenTriangle = new VertexBuffer(GraphicsDevice, typeof(VertexPositionTexture), 3, BufferUsage.WriteOnly); FullscreenTriangle.SetData(new VertexPositionTexture[3] { new VertexPositionTexture(new Vector3(-1, -3, 0), new Vector2(0, 2)), @@ -256,7 +256,7 @@ namespace Kav var previousFarPlane = camera.NearPlane; for (var i = 0; i < NumShadowCascades; i++) { - var farPlane = camera.FarPlane / (MathHelper.Max((NumShadowCascades - i - 1) * 5f, 1f)); + var farPlane = camera.FarPlane / (MathHelper.Max((NumShadowCascades - i - 1) * 2f, 1f)); // divide the view frustum var shadowCamera = new PerspectiveCamera(