poisson sampled soft shadows
parent
7e82f2f32e
commit
a341d3ba93
Binary file not shown.
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue