This commit is contained in:
Brandon Mak 2022-11-01 12:47:50 +08:00
parent 53fc1fce95
commit 78545889da
2 changed files with 4 additions and 1 deletions

View File

@ -78,8 +78,11 @@ void main()
float sampleDepth = imageLoad (positions, ivec2 (offsetPos.xy)).z;
if (sampleDepth == 0.0f)
continue;
float rangeCheck = smoothstep (0.0f, 1.0f, RADIUS / abs (viewSpacePos.z - sampleDepth));
occlusion += (sampleDepth <= samplePos.z + BIAS ? 1.0f : 0.0f) * rangeCheck;
occlusion += (sampleDepth <= samplePos.z - BIAS ? 1.0f : 0.0f) * rangeCheck;
//occlusion += (sampleDepth <= samplePos.z + BIAS ? 1.0f : 0.0f);
}

Binary file not shown.