Skip to main content

optical_depth

Function optical_depth 

Source
pub fn optical_depth(
    start: Vec3,
    dir: Vec3,
    atm: &AtmosphereParams,
    n_steps: usize,
) -> Vec2
Expand description

Compute the optical depth (column density) from start to the atmosphere boundary, and also toward the sun for shadow computation.

Returns Vec2(rayleigh_depth, mie_depth).

§Parameters

  • start — starting position in world space (planet-centred, metres)
  • dir — ray direction (normalised)
  • atm — atmosphere parameters
  • n_steps — number of integration steps