StaticcauchyCauchy's dispersion equation: n(lambda) = a + b / lambda^2. See CauchyMaterials for ready-made material coefficients.
Wavelength in nanometres (e.g. ~700 for red, ~400 for violet).
The material's Cauchy a/b coefficients.
StaticrefractVector form of Snell's law (same convention as GLSL's built-in refract()): both incident
and normal must be unit vectors, with normal pointing back against incident (toward the
medium the ray arrived from). Returns undefined on total internal reflection.
Physically-based optics helpers: vector Snell's law refraction and Cauchy dispersion, for any effect that needs a real refracted ray direction (a prism, a lens preview, chromatic aberration) instead of a hand-placed decorative angle. 2D-only for now (extracted from
apps/showcases/28's prism dispersion, its one proven use case) -- add aVector3Doverload only once a second, real 3D use case needs it.