pub struct PostProcessPass {Show 24 fields
pub enabled: bool,
pub shader_handle: u64,
pub time_us: u64,
pub bloom_enabled: bool,
pub bloom_intensity: f32,
pub bloom_threshold: f32,
pub bloom_radius: f32,
pub bloom_mip_count: u32,
pub tone_mapping: ToneMappingOperator,
pub exposure: ExposureController,
pub gamma: f32,
pub vignette_enabled: bool,
pub vignette_intensity: f32,
pub vignette_smoothness: f32,
pub chromatic_aberration_enabled: bool,
pub chromatic_aberration_intensity: f32,
pub film_grain_enabled: bool,
pub film_grain_intensity: f32,
pub dithering_enabled: bool,
pub color_lut_handle: u64,
pub color_lut_enabled: bool,
pub saturation: f32,
pub contrast: f32,
pub brightness: f32,
}Expand description
Post-processing pass: bloom, tone mapping, and anti-aliasing.
Fields§
§enabled: boolWhether post-processing is enabled.
shader_handle: u64Shader program handle.
time_us: u64Time taken (microseconds).
bloom_enabled: boolBloom settings.
bloom_intensity: f32§bloom_threshold: f32§bloom_radius: f32§bloom_mip_count: u32§tone_mapping: ToneMappingOperatorTone mapping operator.
exposure: ExposureControllerExposure controller.
gamma: f32Gamma correction value.
vignette_enabled: boolVignette settings.
vignette_intensity: f32§vignette_smoothness: f32§chromatic_aberration_enabled: boolChromatic aberration.
chromatic_aberration_intensity: f32§film_grain_enabled: boolFilm grain.
film_grain_intensity: f32§dithering_enabled: boolDithering (reduces banding in gradients).
color_lut_handle: u64Color grading LUT texture handle.
color_lut_enabled: bool§saturation: f32Saturation adjustment (1.0 = no change).
contrast: f32Contrast adjustment (1.0 = no change).
brightness: f32Brightness adjustment (0.0 = no change).
Implementations§
Source§impl PostProcessPass
impl PostProcessPass
pub fn new() -> Self
Sourcepub fn execute(
&mut self,
hdr_fb: &HdrFramebuffer,
_viewport: &Viewport,
dt: f32,
)
pub fn execute( &mut self, hdr_fb: &HdrFramebuffer, _viewport: &Viewport, dt: f32, )
Execute the post-processing pass.
Sourcepub fn bloom_extract(&self, color: [f32; 3]) -> [f32; 3]
pub fn bloom_extract(&self, color: [f32; 3]) -> [f32; 3]
Apply bloom extraction (returns which pixels are bright enough).
Sourcepub fn color_adjust(&self, color: [f32; 3]) -> [f32; 3]
pub fn color_adjust(&self, color: [f32; 3]) -> [f32; 3]
Apply saturation/contrast/brightness adjustments.
Sourcepub fn fragment_shader(&self) -> String
pub fn fragment_shader(&self) -> String
Generate the post-process fragment shader.
Trait Implementations§
Source§impl Debug for PostProcessPass
impl Debug for PostProcessPass
Auto Trait Implementations§
impl Freeze for PostProcessPass
impl RefUnwindSafe for PostProcessPass
impl Send for PostProcessPass
impl Sync for PostProcessPass
impl Unpin for PostProcessPass
impl UnsafeUnpin for PostProcessPass
impl UnwindSafe for PostProcessPass
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
Mutably borrows from an owned value. Read more
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.