Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: pb shadow improvements #789

Merged
merged 2 commits into from
Nov 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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