Builtin Library
- ..
- README.md1.7 KB
- bindings.yaml731 B
- shader.wgsl5.6 KB
README.md
media_view
The participating media as the camera sees them. Each pixel's view ray is
marched across the stretches of medium it crosses in front of the surface (or,
over the sky, until it leaves the last medium), steps samples a stretch:
what is behind the medium is dimmed by exp(-tau) of the optical depth in
front of it, and the medium adds the light it scatters toward the camera, lit
by the scene's sun (dimmed by the media between each sample and the sun,
@frame.light) and by its surroundings: the light a surface standing there
takes from the scene's ambient term, the sky and reflection probes the
environment captured and the baked light-probe volumes, averaged over every
direction, the ambient term and the sky as far as the point sees the sky past
what stands over it. The surroundings' light is read from the surroundings
grid vol_surroundings states for the view (surroundings_grid), once per
stretch. A sample reads the density of the media its ray crosses, and the
optical depth toward the sun through the media the sun's light can cross on
its way to the stretch (media_reached_along), so a pixel costs what the
media in front of it are rather than what every registered medium is. With
the sun, the ambient and the environment dark a medium scatters nothing.
Includes
media_common@builtin::shaderModules.frame_lightsurroundings_grid
Bindings
| name | kind |
|---|---|
source_map | texture2d |
scene_depth | texture_depth |
frame_cam | buffer |
scene_light | buffer |
vol_surroundings | buffer |
media_params | buffer |
media_volumes | buffer |
media_out | storage2d (rgba16f) |