Skip to content

Fix TAA ghosting artifacts on WebGPU#8517

Merged
mvaligursky merged 1 commit intomainfrom
mv-fix-taa-webgpu
Mar 10, 2026
Merged

Fix TAA ghosting artifacts on WebGPU#8517
mvaligursky merged 1 commit intomainfrom
mv-fix-taa-webgpu

Conversation

@mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Mar 10, 2026

Fix TAA temporal reprojection producing ghost images on WebGPU when the camera moves (fixes #8452).

Changes:

  • Fix the TAA resolve shader's reproject() function to correctly account for the UV Y-flip applied by getImageEffectUV on WebGPU — the input UV is un-flipped before NDC reconstruction and the output UV is re-flipped back to texture sampling convention
  • Remove the UV flip hack from the TAA resolve shader's main() that was producing an upside-down image as a workaround
  • Remove the compensating UV flip in both GLSL and WGSL compose shaders that was correcting for the TAA upside-down output
  • Clean up dead #ifdef WEBGPU / #ifndef WEBGPU code in the GLSL TAA resolve shader, since GLSL post-processing chunks are no longer used on WebGPU

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
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 mvaligursky merged commit 8be9715 into main Mar 10, 2026
12 checks passed
@mvaligursky mvaligursky deleted the mv-fix-taa-webgpu branch March 10, 2026 10:45
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Graphics related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TAA looks incorrect in webgpu

2 participants