Builtin Library
- ..
- README.md1.0 KB
- bindings.yaml689 B
- shader.wgsl2.5 KB
README.md
medium_media_trace (raster shader)
Lays the participating media's trace in the media trace (@scene.media,
@scene.mediaSurface) for the mediaShadow render feature: one triangle over
the whole view, whose fragments follow each pixel's view ray through the
registered media up to the opaque surface, and lay what the media take of the
light behind them (one less the share the view march keeps, from the optical
depth along the ray under the media's strength) as a volumetric medium
standing where the ray first enters one, facing back along the ray. A pixel
whose ray crosses no medium draws nothing.
cam is the drawn camera (@frame.camera), media_params and
media_volumes the registered media as
@builtin::systems.volumetrics.mediaTransmittance packs them, and
scene_depth the scene's depth, where each ray ends and 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.