Skip to content

feat(taa): Overhaul TAA implementation for improved quality/upscaling#9573

Merged
pixelflinger merged 1 commit intomainfrom
ma/taa-improvements
Jan 7, 2026
Merged

feat(taa): Overhaul TAA implementation for improved quality/upscaling#9573
pixelflinger merged 1 commit intomainfrom
ma/taa-improvements

Conversation

@pixelflinger
Copy link
Collaborator

This commit introduces a significant rework of the Temporal Anti-Aliasing (TAA) system, focusing on improving reconstruction quality, robustness, and introducing flexible upscaling.

Core TAA Algorithm improvements:

  • Replaced the Catmull-Rom filter with a more efficient 5-tap Lanczos filter for history sampling, which includes deringing to reduce artifacts.
  • The input color buffer is now properly "unjittered" using a Lanczos reconstruction filter.
  • Improved the history rejection algorithm by skipping the expensive accurate clipping when the history sample is already within the neighborhood's color gamut.
  • Added a new hdr option to properly handle HDR content by tonemapping colors before blending and untonemapping the result.
  • Removed the ineffective VARIANCE only history rejection method.
  • Added protection against negative numbers in sqrt() for increased stability.

TAA Upscaling:

  • Replaced the boolean upscaling flag with a float factor, allowing for variable upscaling ratios (e.g., 1.5x, 2x).
  • Upscaling now correctly adjusts viewport and projection settings.
  • The TAA shader now receives viewport and resolution information to correctly handle upscaled rendering.

API and Configuration Changes:

  • Deprecated the filterWidth TAA option as it no longer has an effect.
  • Introduced the upscaling float property to TemporalAntiAliasingOptions.
  • Added the hdr boolean property to TemporalAntiAliasingOptions.

Other Changes:

  • Updated UI elements in the viewer and material sandbox to reflect the new TAA options.
  • Updated Javascript bindings and TypeScript definitions for the new TAA settings.
  • Refactored shader code for clarity and performance.

…ling

This commit introduces a significant rework of the Temporal Anti-Aliasing (TAA) system, focusing on improving reconstruction quality, robustness, and introducing flexible upscaling.

Core TAA Algorithm improvements:
- Replaced the Catmull-Rom filter with a more efficient 5-tap Lanczos filter for history sampling, which includes deringing to reduce artifacts.
- The input color buffer is now properly "unjittered" using a Lanczos reconstruction filter.
- Improved the history rejection algorithm by skipping the expensive accurate clipping when the history sample is already within the neighborhood's color gamut.
- Added a new `hdr` option to properly handle HDR content by tonemapping colors before blending and untonemapping the result.
- Removed the ineffective `VARIANCE` only history rejection method.
- Added protection against negative numbers in `sqrt()` for increased stability.

TAA Upscaling:
- Replaced the boolean `upscaling` flag with a float factor, allowing for variable upscaling ratios (e.g., 1.5x, 2x).
- Upscaling now correctly adjusts viewport and projection settings.
- The TAA shader now receives viewport and resolution information to correctly handle upscaled rendering.

API and Configuration Changes:
- Deprecated the `filterWidth` TAA option as it no longer has an effect.
- Introduced the `upscaling` float property to `TemporalAntiAliasingOptions`.
- Added the `hdr` boolean property to `TemporalAntiAliasingOptions`.

Other Changes:
- Updated UI elements in the viewer and material sandbox to reflect the new TAA options.
- Updated Javascript bindings and TypeScript definitions for the new TAA settings.
- Refactored shader code for clarity and performance.
@pixelflinger pixelflinger added the internal Issue/PR does not affect clients label Jan 5, 2026

// xvp = vp;
// xvp.left = xvp.bottom = 0;
// svp = xvp;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: you may want to remove unless it's for debugging

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, it here because the upscaling is still buggy [BETA], and that's basically debugging stuff I want to keep around.

xvp.height *= 2;
// FIXME: this rounds xvp incorrectly

xvp.left *= taaOptions.upscaling;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you could use xvp.left = std::round(xvp.left * taaOptions.upscaling); to prevent truncation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no the problem is actually deeper that than,, so while this might help (I'm not even sure), this wouldn't be the correct fix anyways.

Comment on lines +117 to +118
//postProcess.vertex.xy = uvToRenderTargetUV(
// materialParams.colorViewport.xy + uv * materialParams.colorViewport.zw);
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe remove?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

same thing, it's part of what's needed to make it really work, so it's still debug code for upscaling.

Copy link
Contributor

@show50726 show50726 left a comment

Choose a reason for hiding this comment

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

I'd like to see if there's any screenshot compariing the original method and improved method.

@pixelflinger pixelflinger merged commit 85ebd67 into main Jan 7, 2026
18 checks passed
@pixelflinger pixelflinger deleted the ma/taa-improvements branch January 7, 2026 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Issue/PR does not affect clients

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants