Repository navigation
feat(examples): S5 radiance cascades GI, upscaled instead of TRAA - #106
Merged
Merged
Conversation
Ports zalo's real-time radiance cascades demo (mrdoob/three.js#35349) and swaps its traa() resolve for upscale(). The addon renders its own G-buffer inside the render pipeline, so the pipeline-hook jitter lands on it; the G-buffer and every GI pass run at 1/ratio and the upscaler reconstructs the display image from the composite + G-buffer depth/velocity. The addon is vendored with two marked patches: a local isBackgroundDepth() (three's dev branch has it, r186 doesn't) and an explicit renderSize for the G-buffer. The TRAA path sets r186 TRAA's depth history to float so it can copy the cascades' depth32float. Assets stream from pinned commits. GPU-verified headless (Apple Metal, vsync off, worktree, 1600x900, Sponza, still camera): TRAA native 77 fps / GI 11.9 ms; upscaler 2x 146 fps / GI 5.4 ms + 0.6 ms upscale; 3x 187 fps; 2x with render-px probes 214 fps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Probes coarsen with the render scale, so the probe work scales with the render size too (Sponza 2x, 1600x900: GI 5.4 -> 3.1 ms, 146 -> 214 fps; probe memory drops with it). TRAA stays native. 'display px' remains a toggle for a same-GI comparison. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Ports zalo's real-time radiance cascades GI demo (mrdoob/three.js#35349) as showcase S5 (
examples/s5-radiance-cascades) and swaps itstraa()resolve forupscale(). The G-buffer and every GI pass run at 1/ratio and the upscaler reconstructs the display image.OnBeforeFrameUpdatein theFnthat returns the composite), so the pipeline-hook jitter lands on it. The composite is pinned to a render-size texture (convertToTexture(node, w, h)) and handed toupscale()with the G-buffer's depth and velocity.[upscaler port]patches: a localisBackgroundDepth()(on three's dev branch, absent from r186) and an explicitrenderSizefor the G-buffer (null= original behaviour).depth24plusunless reversed depth, so copying the cascades'depth32floatfailed validation every frame. The example sets that private history depth to float so the TRAA comparison runs clean.Results
Headless Chrome, Apple Metal, vsync off, 1600×900, Sponza, still camera, fixed GI quality. Run from a worktree, so absolutes read slow; compare within the table.
Test plan
pnpm typecheck,pnpm lint, examples buildCaveats
mrdoob/three.js.isBackgroundDepthand the TRAA depth fix (r187?), the patch and shim can go.🤖 Generated with Claude Code