feat(taa): Overhaul TAA implementation for improved quality/upscaling#9573
feat(taa): Overhaul TAA implementation for improved quality/upscaling#9573pixelflinger merged 1 commit intomainfrom
Conversation
…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.
|
|
||
| // xvp = vp; | ||
| // xvp.left = xvp.bottom = 0; | ||
| // svp = xvp; |
There was a problem hiding this comment.
nit: you may want to remove unless it's for debugging
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Maybe you could use xvp.left = std::round(xvp.left * taaOptions.upscaling); to prevent truncation.
There was a problem hiding this comment.
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.
| //postProcess.vertex.xy = uvToRenderTargetUV( | ||
| // materialParams.colorViewport.xy + uv * materialParams.colorViewport.zw); |
There was a problem hiding this comment.
same thing, it's part of what's needed to make it really work, so it's still debug code for upscaling.
show50726
left a comment
There was a problem hiding this comment.
I'd like to see if there's any screenshot compariing the original method and improved method.
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:
hdroption to properly handle HDR content by tonemapping colors before blending and untonemapping the result.VARIANCEonly history rejection method.sqrt()for increased stability.TAA Upscaling:
upscalingflag with a float factor, allowing for variable upscaling ratios (e.g., 1.5x, 2x).API and Configuration Changes:
filterWidthTAA option as it no longer has an effect.upscalingfloat property toTemporalAntiAliasingOptions.hdrboolean property toTemporalAntiAliasingOptions.Other Changes: