Skip to content

Commit

Permalink
chore: pb shadow improvements (#789)
Browse files Browse the repository at this point in the history
* chore: pb shadow improvements

* chore: more cleanup
  • Loading branch information
doodlum authored Nov 25, 2024
1 parent 03cf496 commit cb1ccdc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions package/Shaders/Utility.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -381,12 +381,10 @@ float GetPoissonDiskFilteredShadowVisibility(float noise, float2x2 rotationMatri
float visibility = 0;
for (int sampleIndex = 0; sampleIndex < sampleCount; ++sampleIndex) {
float2 sampleOffset = mul(Random::SpiralSampleOffsets8[sampleIndex], rotationMatrix);
sampleOffset *= 1.5;

# if defined(RENDER_SHADOWMASKDPB)
float2 sampleUV = sampleOffset + baseUV.xy;

baseUV.z += noise;
float2 sampleUV = baseUV.xy + sampleOffset * ShadowSampleParam.z;
baseUV.z += noise * ShadowSampleParam.z;

bool lowerHalf = baseUV.z * 0.5 + 0.5 < 0;
float3 normalizedPositionLS = normalize(float3(sampleUV.xy, baseUV.z));
Expand Down

0 comments on commit cb1ccdc

Please sign in to comment.