volume_media_trace.rasterShader
- README.md1.0 KB
- bindings.yaml763 B
- shader.wgsl2.8 KB
This package holds more than this page lists. See all of its files in its world.
README.md
volume_media_trace (raster shader)
Lays a volume's trace in the media trace (@scene.media,
@scene.mediaSurface) for the volume render feature: the far faces of the
volume's box (36 vertices, drawn with cull = "front"), which cover the pixels
the box stands on once each, from outside the box or in it, whose fragments
read the coverage the volume's march (volume_draw)
laid at each pixel, filtered up from the march's resolution as the volume's
composite reads it, and lay it as a volumetric medium standing where the
pixel's ray enters the volume's box, facing back along the ray. A pixel the
march laid nothing on draws nothing.
src is the march's target, cam the drawn camera (@frame.camera), U the
volume's uniforms (its box at words 5 and 6), scene_depth the scene's depth,
whose size the trace is drawn at. The pass writes @scene.media at
@location(0) and @scene.mediaSurface at @location(1), both
"premultiplied", and runs only on a view that keeps the trace.