Advanced search tips: use spaces to require multiple terms (AND), |
for alternatives (OR), wrap phrases in quotes (="a b"), =term for
exact match, 'term to include, !term to exclude, ^term to match
prefix, !^term to exclude prefix, .ext$ to match suffix, and !.ext$ to
exclude suffix.
RGB channels: total inscattered light along the camera ray to the current sample.
A channel: average transmittance across all wavelengths to the current sample.
calling with component = 0.0 will return the atmosphere’s absorption density,
while calling with component = 1.0 will return the atmosphere’s scattering density.
We assume the up vector at the view position is the y axis, since the world is locally flat/level.
t = distance along view ray in atmosphere space
NOTE: this means that if your world is actually spherical, this will be wrong.
Modified from skybox.wgsl. For this pass we don’t need to apply a separate sky transform or consider camera viewport.
Returns a normalized ray direction in world space.
FIXME: this function should be in bruneton_functions.wgsl, but because naga_oil doesn’t support cyclic imports it’s stuck here