Log inGet started
Package

media_view.computeShader

Newest version

This package holds more than this page lists. See all of its files in its world.

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_light
  • surroundings_grid

Bindings

namekind
source_maptexture2d
scene_depthtexture_depth
frame_cambuffer
scene_lightbuffer
vol_surroundingsbuffer
media_paramsbuffer
media_volumesbuffer
media_outstorage2d (rgba16f)