Shogo Oshima

Web Developer

Sketches
GitHub X

#415Crepuscular Sunset

An optics demo of atmospheric scattering rather than a painted sky. For every screen ray the view→sun angle feeds a Rayleigh phase (λ^-4, blue-biased) and a Henyey-Greenstein Mie phase (forward-peaked), while the view elevation sets an airmass that thickens toward the horizon. Single-scatter inscatter (β·phase/β_total)·(1−transmittance) builds the gradient analytically — blue overhead, reddening down low as the long path extincts blue — and the sun disc glows through the same transmittance so it deepens orange near the horizon. A short screen-space march samples thin striations to hint the crepuscular rays. Move to steer the sun, scroll to thicken the air.