Builtin Library
- ..
- README.md1.7 KB
- module.wgsl3.4 KB
README.md
dn_persist
The body both denoise_persist variants run. An accumulation stored as rgba8
and one stored as rgba16f differ only in the format written, so the pass
itself is written once here and included by each variant.
What it does
Copies the frame dn_temporal resolved, and the guide that goes with it, into
the pair the accumulation is carried across frames in.
The passes a render feature enqueues run once per render target drawn — the viewport, an offscreen capture, a camera rendering into a texture — and each of those is a different view of the scene. One accumulation stands for one of them, so this pass compares the camera being drawn against the camera the accumulation belongs to and writes only when they are the same: three points spread across the frame are put into the world by the drawn camera's inverse view-projection and back onto the frame by the owner's view-projection, and they have to land where they started. Every other render target resolves against the accumulation and leaves it as it stands.
Bindings the including variant declares
| name | kind | what it is |
|---|---|---|
dn_src | texture2d | the frame dn_temporal resolved |
dn_guide_src | texture2d | the guide that frame wrote — (world position, age) |
frame_cam | buffer (read, vec4) | the drawn camera — [0..4) is its inverse view-projection |
dn_persist_settings | buffer (read, vec4) | [0..4) — the owner camera's view-projection, column-major |
dn_hist_out | storage2d | the accumulation carried to the next frame |
dn_guide_out | storage2d (rgba16f) | the guide carried with it |