pub struct ScanlineParams {
pub enabled: bool,
pub intensity: f32,
pub line_width: f32,
pub spacing: u32,
pub horizontal: bool,
pub vsync_wobble: f32,
pub persistence: f32,
pub smoothness: f32,
pub tint: [f32; 3],
}Expand description
CRT scanline pass parameters.
Fields§
§enabled: bool§intensity: f32Brightness reduction for scanline pixels (0.0 = no effect, 0.5 = half brightness).
line_width: f32How many pixels per scanline period (1.0 = every other pixel, 2.0 = every 2 pixels).
spacing: u32Number of screen lines between darkened scanlines (1 = every other, 2 = every 3rd).
horizontal: boolScanline orientation: true = horizontal (CRT rows), false = vertical (rotated CRT).
vsync_wobble: f32Vertical sync wobble amplitude in pixels (0.0 = none, simulates V-sync instability).
persistence: f32Phosphor persistence: darkened areas slightly glow after scan (0.0 = none, 1.0 = strong).
smoothness: f32Curvature of the scanline intensity: 0.0 = sharp, 1.0 = smooth gradient.
tint: [f32; 3]Scanline color tint (for color CRT monitors, slight green/cyan tint).
Implementations§
Source§impl ScanlineParams
impl ScanlineParams
Sourcepub fn arcade() -> Self
pub fn arcade() -> Self
Classic arcade CRT (strong scanlines, slight green tint, minimal wobble).
Sourcepub fn evaluate(&self, pixel_y: f32, screen_height: f32, time: f32) -> f32
pub fn evaluate(&self, pixel_y: f32, screen_height: f32, time: f32) -> f32
CPU preview: evaluate the scanline dimming factor for a pixel at screen Y position.
Returns a multiplier in [0, 1] — multiply pixel brightness by this value.
pixel_y is the pixel row (0 = top), screen_height is total height.
time drives V-sync wobble animation.
Trait Implementations§
Source§impl Clone for ScanlineParams
impl Clone for ScanlineParams
Source§fn clone(&self) -> ScanlineParams
fn clone(&self) -> ScanlineParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ScanlineParams
impl Debug for ScanlineParams
Auto Trait Implementations§
impl Freeze for ScanlineParams
impl RefUnwindSafe for ScanlineParams
impl Send for ScanlineParams
impl Sync for ScanlineParams
impl Unpin for ScanlineParams
impl UnsafeUnpin for ScanlineParams
impl UnwindSafe for ScanlineParams
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.