Builtin Library
- ..
- README.md1.1 KB
- bindings.yaml957 B
- shader.wgsl2.1 KB
README.md
cloud_media_trace (raster shader)
Lays the cloud layer's trace in the media trace (@scene.media,
@scene.mediaSurface) for the volumetricSky render feature: one triangle
over the whole view, whose fragments read the coverage the layer's cells hold
under each pixel (src) and lay it as the cloud layer, standing where the
pixel's ray enters the layer's shell, facing back along the ray. A pixel no
cell covers draws nothing.
It runs beside each of the layer's two composites: over the sky (sky_only
1, after the opaque scene is lit, before the transparent phase lays its own
trace in front of it) and over the cells a surface stands on (at the head of
the medium stage). cam is the drawn camera (@frame.camera), U the
raymarch's uniforms (the planet's radius, the ground's height and the layer's
base and top at words 0 to 3) and 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.