Builtin Library
README.md
referenceView
The public surface of the path-traced reference view: enable, disable,
active, settings, reset, refresh.
It owns three things the render feature does not:
-
The scene snapshot.
compute.buildBvhover every visible mesh-bearing world entity, the packed light array, and the alpha-cutout coverage pages — all in the GPU buffersM.bufferscarries for the feature to bind — the tracer shader's own by name, the BVH pair as handles. Rebuilding an acceleration structure per frame would cost more than the tracing does, so the snapshot is taken atenableand retaken only onrefresh. -
The accumulation state. How many samples the buffer holds, and the batch the next frame adds. A fresh accumulation is signalled by a base of zero, which the trace kernel reads as "overwrite" — so a reset is one number, not a buffer clear.
-
The camera watch.
__framereads the active camera every frame and restarts the accumulation the moment it differs, within a tolerance that keeps a nominally-still camera's last-bit jitter from preventing convergence entirely.
Primary rays are generated from an origin, an orthonormal basis and a lens packed into the parameter block, rather than from an inverse view-projection bound per render target. That is what lets one accumulation buffer stay coherent while the passes run in every target drawn that frame.