| Class | Preetham (alias: SunSkyLight) |
| Family | Environment shader (Sky + analytic shader) |
| Author(s) | Preetham, Shirley, Smits |
| Year | 1999 |
| Reference | Preetham, A.J., Shirley, P., Smits, B. (1999). A practical analytic model for daylight. Proc. SIGGRAPH 1999, pp. 91–100. |
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.
| Parameter | Type | Range | Description |
|---|---|---|---|
| turbidity | float | 1 – 10 | Atmospheric turbidity. 1 = pure Rayleigh, 2–3 = clear, 6–10 = hazy/polluted. |
| sun | Vector3d | unit vector | Sun direction (should point away from the ground; y-up convention). |
| radianceFactor | float | > 0 | Global radiance scale factor. |
| disableLight | boolean | — | Suppress sky contribution (use only sun disc). |
| disableSun | boolean | — | Suppress sun disc contribution (use only sky dome). |
| Twilight (Sunflow) | ✅ continuous sampling per ray |
| GPUFlux | ✅ pre-baked 512×512 importance-sampled environment map |
| OpenGL / Proteus | background colour only |
SunSkyLight is a backward-compatible alias. Scripts using new SunSkyLight() continue to work unchanged.