taa_resolve.computeShader
- README.md3.5 KB
- bindings.yaml802 B
- shader.wgsl16.7 KB
This package holds more than this page lists. See all of its files in its world.
README.md
taa_resolve
Carries one frame's accumulation forward into the next: the temporal resolve
(temporal_resolve) at render scale 1. Finds where each pixel's surface was
last frame, reads what that frame decided there through a Catmull-Rom spline,
and folds this frame's estimate into it (the 3x3 samples weighted by where the
render's sub-pixel offset landed each against the pixel's centre) as one sample
among the renders the pixel's history holds — so a silhouette gains a gradient
and a specular highlight stops flashing as it crosses the sample point.
The history is only usable where it still describes the same surface. Velocity is taken from the nearest pixel of the 3x3 neighbourhood; a reprojection off the frame starts over; a pixel where the previous render held a surface well in front of the one there now starts over; and what survives is clipped into the neighbourhood's own colour statistics in YCoCg along the line from the mean — which is what stops a newly-uncovered pixel from trusting the history of whatever was covering it.
Bindings
| name | kind |
|---|---|
scene_color | texture2d |
scene_depth | texture_depth |
scene_motion | texture2d |
taa_history | texture2d |
taa_depth_history | texture2d |
taa_temporal_history | texture2d |
taa_lean_history | texture2d |
frame_cam | buffer |
taa_params | buffer |
taa_state | buffer |
taa_out | storage2d (rgba16f) |
taa_depth_out | storage2d (r32f) |
taa_temporal_out | storage2d (rgba16f) |
taa_lean_out | storage2d (r32f) |
taa_params carries the tuning (historyWeight, neighbourhoodClamp,
motionRejection, stillSamples, and the length of the jitter sequence),
packed by
@builtin::systems.antiAliasing.temporalAntiAliasing. taa_state is the
history target's state buffer, written by the engine before each render of a
view: x whether taa_history holds that view's previous result, y how many
renders in a row have carried it, zw the render's sub-pixel offset in pixels.
frame_cam is the camera drawing the view (@frame.camera): its inverse
view-projection and position, which turn a depth sample into a distance.
taa_depth_out records each pixel's distance from the camera, and
taa_depth_history is the previous render's. taa_temporal_out records, per
pixel, how many renders its history holds (x), how far its estimates' luma
has strayed from the history over the last passes through the jitter sequence
(the reach, y), how many renders in a row it has stood still (z) and how
many renders ago its neighbourhood last held two surfaces apart in depth (w).
taa_lean_out records for how many renders in a row the estimate has stood on
one side of the history, negative below it. taa_temporal_history and
taa_lean_history are the previous render's.
On a still pixel at a silhouette the history stands unclipped while the estimate stays within the reach: a thin edge that leaves the 3x3 samples on some renders of the jitter sequence is averaged rather than clipped toward whichever side the samples fell. The history is the mean of the estimates, so within every pass the jitter puts estimates on both sides of it; a change of the picture (a light switched off or on) puts every estimate on one side of it. Once the estimates have stood on one side of the history for a whole pass, it is clipped like any other, and the reach does not learn the change.