Renderer · interface
Atmosphere
Atmosphere fields shared by every visible render pass.
Explained in Hello world.
interface Atmosphereimport type { Atmosphere } from '@driftengine/core';Properties
| Name | Type | Description |
|---|---|---|
fogColor | Vec3 | |
fogDensity | number | Extinction per metre at fogBaseY, not at the camera. Air thins with
height (see fogHeightFalloff), so the authored number describes the haze
where it is thickest and the camera's altitude does the rest. |
fogHeightFalloff | number | Reciprocal scale height of the haze, per metre: density at height y is
fogDensity · exp(−(y − fogBaseY) · fogHeightFalloff). 0 is a uniform
medium, which is what an authored vista or an indoor scene wants.MoreReal aerial perspective thins with altitude because there is less air above you, and that is the whole difference between looking along a valley and looking down a mountain. A world with no vertical extent cannot tell the two apart and does not need this; one with 232 m of band very much does. |
fogBaseY | number | The height the haze is thickest at — the sea, usually. |
fogModeoptional | 'exponential' | 'linear' | Which curve the haze follows. Absent means exponential, which is the physical one
and what every existing world is authored against.More
|
fogNearoptional | number | Linear mode only: where haze begins, and where it is total. |
fogFaroptional | number | |
fogStartoptional | number | The medium only: how far along the view ray it begins, in metres. Absent or 0 is at the
camera, as every world before it was drawn.MoreThe air nearer than this is perfectly clear, and what lies beyond is fogged by the air past
this point alone — so a faint, bright haze can lie over a distant crowd while the figures a
few metres from the camera stay sharp, which no density can do when the medium starts at the
eye: there it veils the whole frame, lifting the shadows and draining the colour before it
reaches anything far enough to want it. Unlike |
underwater | UnderwaterAtmosphere | null |