Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.

Functions

transmittance_lut_r_mu_to_uv

#

Mapping from view height ® and zenith cos angle (mu) to UV coordinates in the transmittance LUT Assuming r between ground and top atmosphere boundary, and mu= cos(zenith_angle) Chosen to increase precision near the ground and to work around a discontinuity at the horizon See Bruneton and Neyret 2008, “Precomputed Atmospheric Scattering” section 4

fn transmittance_lut_r_mu_to_uv (
atm: Atmosphere
, 
r: f32
, 
mu: f32
) -> vec2<f32>

transmittance_lut_uv_to_r_mu

#

Inverse of the mapping above, mapping from UV coordinates in the transmittance LUT to view height ® and zenith cos angle (mu)

fn transmittance_lut_uv_to_r_mu (
uv: vec2<f32>
) -> vec2<f32>

distance_to_top_atmosphere_boundary

#

Simplified ray-sphere intersection where: Ray origin, o = [0,0,r] with r <= atmosphere.outer_radius mu is the cosine of spherical coordinate theta (-1.0 <= mu <= 1.0) so ray direction in spherical coordinates is [1,acos(mu),0] which needs to be converted to cartesian Direction of ray, u = [0,sqrt(1-mu*mu),mu] Center of sphere, c = [0,0,0] Radius of sphere, r = atmosphere.outer_radius This function solves the quadratic equation for line-sphere intersection simplified under these assumptions

fn distance_to_top_atmosphere_boundary (
atm: Atmosphere
, 
r: f32
, 
mu: f32
) -> f32

distance_to_bottom_atmosphere_boundary

#

Simplified ray-sphere intersection as above for intersections with the ground

fn distance_to_bottom_atmosphere_boundary (
r: f32
, 
mu: f32
) -> f32

ray_intersects_ground

#
fn ray_intersects_ground (
r: f32
, 
mu: f32
) -> bool

sample_transmittance_lut_segment

#

NOTICE: This function is copyrighted by Eric Bruneton and INRIA, and falls under the license reproduced in bruneton_functions.wesl (variant of MIT license)

fn sample_transmittance_lut_segment (
r: f32
, 
mu: f32
, 
t: f32
) -> vec3<f32>
Contents