pub struct FxaaPass {
pub enabled: bool,
pub quality: FxaaQuality,
pub shader_handle: u64,
pub time_us: u64,
pub custom_edge_threshold: f32,
pub custom_subpixel_quality: f32,
pub show_edges: bool,
}Expand description
FXAA post-processing pass.
Fields§
§enabled: boolWhether FXAA is enabled.
quality: FxaaQualityQuality preset.
shader_handle: u64Shader program handle.
time_us: u64Time taken for this pass (microseconds).
custom_edge_threshold: f32Custom edge threshold override (0 = use preset).
custom_subpixel_quality: f32Custom subpixel quality override (negative = use preset).
show_edges: boolWhether to show edges only (debug mode).
Implementations§
Source§impl FxaaPass
impl FxaaPass
pub fn new() -> Self
pub fn with_quality(self, quality: FxaaQuality) -> Self
Sourcepub fn edge_threshold(&self) -> f32
pub fn edge_threshold(&self) -> f32
Get the effective edge threshold.
Sourcepub fn subpixel_quality(&self) -> f32
pub fn subpixel_quality(&self) -> f32
Get the effective subpixel quality.
Sourcepub fn luminance(r: f32, g: f32, b: f32) -> f32
pub fn luminance(r: f32, g: f32, b: f32) -> f32
Compute the luminance of an RGB color (sRGB-weighted).
Sourcepub fn process_pixel<F>(
&self,
center_x: u32,
center_y: u32,
width: u32,
height: u32,
sample: F,
) -> [f32; 3]
pub fn process_pixel<F>( &self, center_x: u32, center_y: u32, width: u32, height: u32, sample: F, ) -> [f32; 3]
Perform FXAA on a single pixel (CPU reference implementation). Takes a pixel sampler closure that returns (r, g, b) given (x, y) offsets.
Sourcepub fn fragment_shader(&self) -> String
pub fn fragment_shader(&self) -> String
Generate the FXAA fragment shader.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FxaaPass
impl RefUnwindSafe for FxaaPass
impl Send for FxaaPass
impl Sync for FxaaPass
impl Unpin for FxaaPass
impl UnsafeUnpin for FxaaPass
impl UnwindSafe for FxaaPass
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.