Repository navigation
GTAONode: Fix false self-occlusion on distant slanted surfaces - #34718
Conversation
- Remove temporary render-target variables used only for readback. - Reuse the wall material for the identical blocker instead of allocating and disposing a second material. - Remove the redundant render-target reset from fixture disposal. Keep all shader guards, regression cases, assertions, and resource ownership. All 42 visibility readbacks match before/after on both physical GPUs.
Preserve the manual GPU harness on repro/gtao-subpixel-self-occlusion rather than adding a standalone test entry point to the shader-fix PR. Match surrounding comment spacing and center terminology, and place the sample-validation explanation alongside the shared rule. No existing upstream tests, test registration, shader behavior, or generated files are changed.
|
At what resolution scale are you using |
|
Thanks for the quick follow-up! In the above screenshots I used resolutionScale = 1.
I believe its due to pixel-grid alignment, at full resolution AO pixel centres line up with depth pixel centres. At half and quarter resolution, they fall between depth pixel centers. |
|
That's why I asked. When resolution scale is lower than 1, we use use a texture gather which automatically prevents the issue from appearing. I now wondering if we should use a different code path for the full resolution case... The "off-screen check" is actually useful for any resolution scale. I'll try to refactor the code a bit. |
|
Can you please test the new version? Is the quality improvement still in place? I think the snap is not required to fix the visuals. The bug came mainly from samples that land inside the center texel (and these are still rejected). |
|
Thanks! I retested your latest commit on the slanted wall and the main improvement is still there. I'm happy with your changes - I agree it’s a better minimal fix. Raw AO visibility for the isolated wall at resolutionScale = 1:
|
|
Glad to hear that! I think what we have now is a well balanced change that solves the reported issue but in a minimal invasive way. And the "off-screen check" is something beneficial for every code path. |
Related issue: -
Description
I noticed that the AO pass falsely occludes distant slanted objects.
Root cause: Sampled depth in the shader belongs to the selected texel center, not necessarily to rayUV.
Fix: Snap ray UVs to depth-texel centers using the depth texture’s dimensions, then use those UVs for both sampling and reconstruction.
AO comparison
Isolated-wall centre visibility: 0.631 → 0.968 (ideal: 1).
Performance
Game scene, Chrome 153, Linux, WebGPU, 960×540 high; Frame intervals in ms (p50 / p95 / p99):