Builtin Library
- ..
- README.md2.3 KB
- bindings.yaml403 B
- shader.wgsl11.1 KB
README.md
taau_resolve
One composite-resolution pixel per invocation: read the presented frame, find where its surface was last frame, and mix the accumulation into it.
The pass runs at a post-scene phase, where @scene.color is the composited
image — the display's own resolution while the renderer presents the viewport
itself — while @scene.depth and @scene.motion stay at the resolution the
scene was rasterized into. Every read of the scene buffers maps the composite
pixel back into that grid; the velocity it finds there is in NDC, which is the
same span at either resolution.
| binding | what it is |
|---|---|
scene_color | the presented frame, composite resolution |
scene_depth | scene depth, scene resolution, reversed (near = 1) |
scene_motion | scene motion in NDC, scene resolution |
taau_history | what this pass resolved last frame, composite resolution |
taau_params | (historyWeight, neighbourhoodClamp, sharpness, motionRejection) |
taau_state | (historyValid, jitterX, jitterY, _) — historyValid is 0 on the first frame of a run; the jitter is the NDC offset the projection carried for the frame being read, which is what places each scene sample inside the pixel |
taau_out | this frame's resolve, composite resolution |
Four things keep the accumulation honest:
- Sample-position weighting. Each of the 4x4 scene taps is weighted by how far its own sample landed from this pixel's centre, jitter included — so a frame that sampled elsewhere contributes little and one that sampled here carries the pixel. Reading the same neighbourhood unweighted would average away exactly the detail the jitter sequence is resolving.
- Velocity dilation. The velocity is taken from the nearest of the 3x3 scene neighbourhood, so a silhouette sweeping across the pixel reprojects along the surface that is actually moving over it.
- Neighbourhood clipping. The history is pulled toward the mean of the current frame's own neighbourhood, along the line between the two, only as far as it takes to enter the colour box that neighbourhood spans.
- Motion-weighted feedback. A long reprojection keeps less of the accumulation, which is what stops a fast object trailing behind itself.