media_common.shaderModule
- README.md914 B
- module.wgsl8.7 KB
This package holds more than this page lists. See all of its files in its world.
README.md
media_common
The participating-media passes' shared ground: the volume record layout, the
occupancy and density of each medium, where a ray enters and leaves one
(media_span), and the optical depth a ray collects through them
(media_optical_depth): each medium's density times the length of the ray
inside it, measured to where its feathered edge holds half its density, read
in one intersection per medium. Across the whole feather of a box's face that
is the integral of its occupancy over the stretch, and across a sphere's edge
or a box's corner it comes close to it. media_all, media_reached_along, volume_density_and_sky_of and
media_optical_depth_of take a set of media as a bit mask, so a pass reads
only the media a ray can reach. The cap on how many volumes one frame carries
(MAX_VOLUMES = 32) sizes a fixed array and the 32 bits of a set, so it is a
constant here rather than a param.