fix: GTAO checkerboard at alpha-cutout silhouettes (white snow-dots on close leaves)#95
Merged
Merged
Conversation
The quad phase dither (the wall-flicker fix) assumes its 2x2 noise is absorbed spatially by the bilateral blur and temporally by the EMA. At alpha-cutout silhouettes - leaf cards up close - both absorbers fail at once: the blur edge-stops on the leaf-to-background depth delta, and wind sway keeps the history reprojecting onto what was sky or another card last frame. The per-phase disagreement then showed through as a stationary pale checkerboard at every leaf edge, which TSR at renderScale < 1 scattered into white snow-dots across the canopy. Reconstruction cannot be saved there, so remove the thing being reconstructed: when a pixel detects the failure signature - its own two directions disagree strongly (the anisotropy of a thin cutout edge), or the surface is in the near field where the screen-radius clamp makes per-direction variance extreme - it scans all 8 horizon directions this frame instead of 2. Such pixels carry the full estimate; nothing is left to disagree with their quad neighbours, so the checkerboard is gone by construction. Flat walls, ground and grass-over-ground keep the cheap 2-direction path. The direction march is factored into scan_direction() (unchanged math); mip_per_step moves to var<private> so the helper can read it. Verified against a stationary in-canopy capture (shooter CAMHOLD harness, 4x zoom crops): the edge lattice is gone at renderScale 1 and the snow-dots are gone at 0.5; SSAO-off had already isolated the pass. Cost in the pathological frame (canopy filling the screen, 0.5 scale): 38 -> 34 fps on the 760M; normal frames only pay for cutout-edge pixels. Claude-Session: https://claude.ai/code/session_018574BdCfSjdpNK3WLgx1hP
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughChangesSSAO horizon scan
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant cs_main
participant scan_direction
participant HiZPyramid
cs_main->>cs_main: Compute mip_per_step
cs_main->>scan_direction: Scan selected horizon directions
scan_direction->>HiZPyramid: Sample per-step mip levels
HiZPyramid-->>scan_direction: Return depth samples
scan_direction-->>cs_main: Return directional visibility
cs_main->>scan_direction: Scan remaining directions when adaptive criteria match
scan_direction-->>cs_main: Return full directional visibility
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
White snow-dots sprinkled over tree canopies whenever the camera gets close to leaves (worst at renderScale 0.5, where TSR scatters the pattern). Reported in the shooter; bisected there with a stationary in-canopy capture: SSAO off = clean, TAA off = raw 50% checkerboard over the whole near leaf card.
Root cause
The GTAO quad phase dither (the fix for the periodic wall-wide AO pulse) splits the 8-direction scan across 4 frames and staggers the phase in a 2x2 pixel quad, relying on the bilateral blur + EMA to absorb the 2x2 noise. At alpha-cutout silhouettes both absorbers fail simultaneously: the blur edge-stops on the leaf-to-background depth delta, and wind sway keeps history reprojecting onto what was sky/another card last frame. The inter-phase disagreement shows through as a stationary checkerboard at every leaf edge.
Fix
Adaptive full scan: when a pixel detects the failure signature — its own two directions disagree by > 0.3 visibility (thin-cutout anisotropy), or it sits in the near field (< 1.5 m, where the screen-radius clamp makes per-direction variance extreme) — it scans all 8 directions this frame. Full-estimate pixels have nothing left to disagree with their quad neighbours, so the checkerboard is gone by construction. Flat walls/ground/grass keep the 2-direction path. The march is factored into
scan_direction()with unchanged math.Verification
https://claude.ai/code/session_018574BdCfSjdpNK3WLgx1hP
Summary by CodeRabbit