Skip to content

GTAONode: Fix dashed creases at a reduced resolution. - #35710

Merged
Mugen87 merged 2 commits into
devfrom
halfres-crease-normal
Nov 25, 2026
Merged

Mugen87 merged 2 commits into
devfrom
halfres-crease-normal

Conversation

@mrdoob

@mrdoob mrdoob commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Related issue: #35361

Description

At a reduced resolution (resolutionScale < 1, e.g. 0.5 in webgpu_postprocessing_ao), GTAONode takes the center depth from the nearest of the 2x2 depth texels. Since #35361, it takes the normal from that texel only at silhouettes (view-space depth difference above 1%). At creases, it keeps the blended normal.

At a crease, the blended normal points between the two surfaces (about 45° at a wall/floor corner), so the corner is shaded as more open than it is. A crease is rarely aligned with the texel grid, so it keeps moving in and out of the 2x2 blocks, and the AO shows dashed light lines along every crease.

This PR takes the normal from the nearest depth texel at creases too, which also removes the 1% test and its two depthToViewZ() calls.

GTAO at half resolution, AO only, averaged over 24 frames:

Before After
Before After
Before After
Before After

The mean absolute error against a Cycles AO render of the same scene goes from 6.21 to 6.15 (out of 255). With TRAA, the camera jitter mostly averages the dashes out, but they show up in the AO-only view and without temporal filtering.

#35361 kept the blended normal at creases because picking one texel makes creases flicker in the SSGI demo. That is still the case for SSGINode (visible at resolutionScale = 0.25), so this PR leaves it unchanged. For GTAO, I measured the frame-to-frame flicker on narrow crops along creases, with TRAA at DPR 2, both with a static camera (TRAA jitter only) and with a slow camera orbit, and couldn't find an increase:

Crease flicker Static Orbit
Before 0.178 2.080
After 0.153 2.047

Flicker is the mean absolute second temporal difference of the final output, out of 255 (it cancels steady camera motion).

Live links

Enable aoOnly in the GUI to see the creases:

@mrdoob mrdoob added this to the r188 milestone Nov 25, 2026
@mrdoob
mrdoob requested a review from Mugen87 November 25, 2026 08:09
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mrdoob
mrdoob force-pushed the halfres-crease-normal branch from 1f7e7d5 to 69ddb1a Compare November 25, 2026 09:43
@Mugen87

Mugen87 commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

The PR works for GTAO. But not with SSGI. The same flicker mentioned in #35361 (comment) is now back. The code you have removed in SSGINode was present to fix this exact flickering.

You can test this by configure a resolution scale of 0.5 in webgpu_postprocessing_ssgi. The corner where the wall meets the celling should be stable.

@mrdoob

mrdoob commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Oh, I didn't see the flicker at 0.5 but I do see it at 0.25:

Screen.Recording.2026-11-25.at.23.07.29.mov

I'll focus this PR on GTAONode.

Picking a single texel at creases makes the ceiling corner flicker in webgpu_postprocessing_ssgi at low resolution scales.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mrdoob mrdoob changed the title GTAONode, SSGINode: Fix dashed creases at a reduced resolution. GTAONode: Fix dashed creases at a reduced resolution. Nov 25, 2026
@mrdoob

mrdoob commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Updated 👌

@Mugen87
Mugen87 merged commit 1d37728 into dev Nov 25, 2026
9 checks passed
@Mugen87
Mugen87 deleted the halfres-crease-normal branch November 25, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants