pub struct ExposureController {Show 16 fields
pub mode: ExposureMode,
pub exposure: f32,
pub target_exposure: f32,
pub manual_exposure: f32,
pub adaptation_speed_up: f32,
pub adaptation_speed_down: f32,
pub min_exposure: f32,
pub max_exposure: f32,
pub ev_compensation: f32,
pub key_value: f32,
pub histogram_low_percentile: f32,
pub histogram_high_percentile: f32,
pub histogram_bins: u32,
pub histogram: Vec<u32>,
pub average_luminance: f32,
pub spot_radius: f32,
}Expand description
Controls automatic exposure adaptation.
Fields§
§mode: ExposureModeCurrent exposure mode.
exposure: f32Current computed exposure value.
target_exposure: f32Target exposure (what we are adapting toward).
manual_exposure: f32Manual exposure override (used when mode == Manual).
adaptation_speed_up: f32Adaptation speed (how fast exposure changes, in EV/sec).
adaptation_speed_down: f32§min_exposure: f32Minimum exposure (prevents screen from going too dark).
max_exposure: f32Maximum exposure (prevents screen from going too bright).
ev_compensation: f32EV compensation (artist-controlled bias).
key_value: f32Key value for average luminance mode (typically 0.18 for 18% gray).
histogram_low_percentile: f32Histogram low percentile to ignore (e.g., 0.1 = bottom 10%).
histogram_high_percentile: f32Histogram high percentile to ignore (e.g., 0.9 = top 10%).
histogram_bins: u32Number of histogram bins.
histogram: Vec<u32>The histogram data (populated each frame).
average_luminance: f32Average luminance computed last frame.
spot_radius: f32Spot metering radius (fraction of screen width).
Implementations§
Source§impl ExposureController
impl ExposureController
pub fn new() -> Self
Sourcepub fn feed_luminance(&mut self, luminance: f32)
pub fn feed_luminance(&mut self, luminance: f32)
Feed the controller a luminance value for the current frame (computed from downsampled HDR buffer).
Sourcepub fn feed_histogram(&mut self, histogram: Vec<u32>)
pub fn feed_histogram(&mut self, histogram: Vec<u32>)
Feed a histogram for the current frame.
Sourcepub fn exposure_multiplier(&self) -> f32
pub fn exposure_multiplier(&self) -> f32
Get the current exposure multiplier for the tone mapping shader.
Trait Implementations§
Source§impl Clone for ExposureController
impl Clone for ExposureController
Source§fn clone(&self) -> ExposureController
fn clone(&self) -> ExposureController
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExposureController
impl Debug for ExposureController
Auto Trait Implementations§
impl Freeze for ExposureController
impl RefUnwindSafe for ExposureController
impl Send for ExposureController
impl Sync for ExposureController
impl Unpin for ExposureController
impl UnsafeUnpin for ExposureController
impl UnwindSafe for ExposureController
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.