Skip to main content

ExposureAdaptation

Struct ExposureAdaptation 

Source
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: f32

Fraction of the remaining distance per second while the exposure climbs.

§darken: f32

The same while it falls.

§delta: f32

How long this frame was, in seconds — the view’s own delta.

Trait Implementations§

Source§

impl Clone for ExposureAdaptation

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ExposureAdaptation

Source§

impl Debug for ExposureAdaptation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ExposureAdaptation

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ExposureAdaptation

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> HalThreadSafe for T
where T: Send + Sync,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.