Functions
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
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