Preetham (1999) — Analytic Daylight Sky

ClassPreetham (alias: SunSkyLight)
FamilyEnvironment shader (Sky + analytic shader)
Author(s)Preetham, Shirley, Smits
Year1999
ReferencePreetham, A.J., Shirley, P., Smits, B. (1999). A practical analytic model for daylight. Proc. SIGGRAPH 1999, pp. 91–100.

Introduction

The Preetham model is a compact analytic formula for sky luminance distribution as a function of turbidity and solar elevation. It is based on Perez's all-weather model and uses a five-parameter function (A–E) fitted from atmospheric measurements. Despite its age it remains widely used for real-time rendering due to its low computational cost and plausible appearance.

Parameters

ParameterTypeRangeDescription
turbidityfloat1 – 10Atmospheric turbidity. 1 = pure Rayleigh, 2–3 = clear, 6–10 = hazy/polluted.
sunVector3dunit vectorSun direction (should point away from the ground; y-up convention).
radianceFactorfloat> 0Global radiance scale factor.
disableLightbooleanSuppress sky contribution (use only sun disc).
disableSunbooleanSuppress sun disc contribution (use only sky dome).

Renderer compatibility

Twilight (Sunflow)✅ continuous sampling per ray
GPUFlux✅ pre-baked 512×512 importance-sampled environment map
OpenGL / Proteusbackground colour only

Notes

SunSkyLight is a backward-compatible alias. Scripts using new SunSkyLight() continue to work unchanged.