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 more