Fix TAA ghosting artifacts on WebGPU#8517
Merged
mvaligursky merged 1 commit intomainfrom Mar 10, 2026
Merged
Conversation
Fix ghosting artifacts in TAA on WebGPU caused by incorrect UV-to-NDC reconstruction in the reproject function. The getImageEffectUV Y-flip applied in the vertex shader was not accounted for, producing wrong world-space positions and broken history reprojection during camera movement. Remove the old upside-down workaround hack from the TAA resolve shader and the compensating UV flip from the compose shader. Clean up dead WEBGPU ifdef blocks in the GLSL TAA resolve shader. Fixed #8452 Made-with: Cursor
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes WebGPU TAA ghosting by correcting UV Y-flip handling during temporal reprojection so history sampling matches the camera matrices’ screen-space convention.
Changes:
- Adjust WGSL TAA
reproject()to un-flip input UV before NDC reconstruction and re-flip output UV for texture sampling. - Remove the previous “flip in main” workaround in TAA resolve shaders.
- Remove the compensating TAA UV flip in both WGSL and GLSL compose shaders.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/scene/shader-lib/wgsl/chunks/render-pass/frag/taaResolve.js | Fixes reprojection by handling WebGPU image-effect UV Y-flip inside reproject() and removes the old flip hack. |
| src/scene/shader-lib/wgsl/chunks/render-pass/frag/compose/compose.js | Removes the TAA-specific Y-flip compensation in the final compose pass. |
| src/scene/shader-lib/glsl/chunks/render-pass/frag/taaResolve.js | Removes dead WebGPU-specific flip/depth conditional logic and aligns sampling to uv0. |
| src/scene/shader-lib/glsl/chunks/render-pass/frag/compose/compose.js | Removes now-unneeded WebGPU/TAA flip compensation block. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mvaligursky
added a commit
that referenced
this pull request
Mar 10, 2026
Fix ghosting artifacts in TAA on WebGPU caused by incorrect UV-to-NDC reconstruction in the reproject function. The getImageEffectUV Y-flip applied in the vertex shader was not accounted for, producing wrong world-space positions and broken history reprojection during camera movement. Remove the old upside-down workaround hack from the TAA resolve shader and the compensating UV flip from the compose shader. Clean up dead WEBGPU ifdef blocks in the GLSL TAA resolve shader. Fixed #8452 Made-with: Cursor Co-authored-by: Martin Valigursky <mvaligursky@snapchat.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.
Fix TAA temporal reprojection producing ghost images on WebGPU when the camera moves (fixes #8452).
Changes:
reproject()function to correctly account for the UV Y-flip applied bygetImageEffectUVon WebGPU — the input UV is un-flipped before NDC reconstruction and the output UV is re-flipped back to texture sampling conventionmain()that was producing an upside-down image as a workaround#ifdef WEBGPU/#ifndef WEBGPUcode in the GLSL TAA resolve shader, since GLSL post-processing chunks are no longer used on WebGPU