pub struct ExposureAdaptation {
pub brighten: f32,
pub darken: f32,
pub delta: f32,
}Expand description
How far one frame’s exposure may travel toward the one its histogram asks for.
Why a step and not the measurement itself. A real eye takes seconds to
adapt; an exposure that lands on its target in a single frame turns a camera
cut, a muzzle flash or a door opening into a flicker. So a view hands this
in every frame with its own delta, and
ForwardRenderer::set_exposure_adaptation
is where it goes.
The two rates differ because the eye’s do. Adapting down to a scene
that just got bright is fast and adapting back up is slow, and a viewer
notices immediately when they are swapped. They are named for what the
exposure does, not for what the scene did: brighten is the exposure
climbing, which is the picture getting brighter as the eye opens up in the
dark.
Each is a fraction of the remaining distance per second, so 2.0 covers
half the distance in a quarter of a second and anything at or above
1.0 / delta arrives in one frame. It is the linear approximation of the
exponential approach every engine writes as 1 - exp(-rate * delta), and it
is linear on purpose: this workspace lets no transcendental reach a colour,
and an exposure multiplies every texel of the frame.
Fields§
§brighten: f32Fraction of the remaining distance per second while the exposure climbs.
darken: f32The same while it falls.
delta: f32How long this frame was, in seconds — the view’s own delta.