pub struct PostFx {Show 17 fields
pub bloom_intensity: f32,
pub bloom_threshold: f32,
pub bloom_knee: f32,
pub bloom_radius: f32,
pub tonemap: Tonemap,
pub exposure: f32,
pub contrast: f32,
pub saturation: f32,
pub lift: [f32; 3],
pub gamma: [f32; 3],
pub gain: [f32; 3],
pub vignette: f32,
pub vignette_softness: f32,
pub grain: f32,
pub aberration: f32,
pub scanlines: f32,
pub auto_hud: bool,
}Expand description
Authored post-processing settings. Start from a preset and adjust with the builder methods. Values are sanitized when applied: non-finite numbers use the neutral value and every field is clamped to its documented range.
use ferravex_render::post::{PostFx, Tonemap};
let fx = PostFx::subtle()
.bloom(0.5, 0.7, 1.2)
.tint(ferravex_render::Color::new(1.05, 1., 0.92, 1.))
.vignette(0.3, 0.5)
.tonemap(Tonemap::Soft);
assert!(!fx.is_off());
assert!(PostFx::off().is_off());Fields§
§bloom_intensity: f32Bloom strength, 0–8. Zero skips the bloom chain. The chain is normalized by its level count, so a value keeps the same overall energy on Medium and High; small bright shapes need roughly 1–3 for a clearly visible halo.
bloom_threshold: f32Brightness (max RGB channel) where bloom starts, 0–4.
bloom_knee: f32Soft-threshold width around the threshold, 0–1.
bloom_radius: f32Upsample filter spread, 0.25–3. One is the dual-filter default.
tonemap: Tonemap§exposure: f32Scene multiplier before tonemapping, 0–8.
contrast: f32Power-law contrast around mid-grey (0.5 * (2c)^contrast), 0–2.
Black stays black, so dark palettes keep their relative detail.
saturation: f32Saturation, 0 (greyscale) – 2.
lift: [f32; 3]Shadow lift per channel, -0.5–0.5.
gamma: [f32; 3]Midtone gamma per channel, 0.2–5. Above one brightens.
gain: [f32; 3]Highlight gain (tint) per channel, 0–4.
vignette: f32Corner darkening, 0–1.
vignette_softness: f32Vignette falloff width, 0.05 (tight corners) – 1 (from the center).
grain: f32Animated film grain amplitude, 0–0.25. Default off.
aberration: f32Radial chromatic aberration, 0–1 (1 ≈ 1% of the screen). Default off.
scanlines: f32Scanline darkening, 0–1, one line every three logical pixels. Default off.
auto_hud: boolTreat set_world_colors(false) / set_default_camera() as the HUD
boundary. Default true.
Implementations§
Source§impl PostFx
impl PostFx
Sourcepub const fn subtle() -> PostFx
pub const fn subtle() -> PostFx
Gentle glow on the brightest pixels, slight contrast/saturation and a light vignette. Unlit areas keep their authored colors.
Sourcepub const fn neon() -> PostFx
pub const fn neon() -> PostFx
Strong, wide glow for dark scenes with saturated emissive shapes.
Sourcepub const fn warm_film() -> PostFx
pub const fn warm_film() -> PostFx
Filmic curve, warm highlights, lifted shadows, soft vignette and a hint of grain.
Sourcepub const fn crt() -> PostFx
pub const fn crt() -> PostFx
Arcade monitor: scanlines, light aberration, bloom and a deep vignette.
Sourcepub fn from_name(name: &str) -> Option<PostFx>
pub fn from_name(name: &str) -> Option<PostFx>
Preset by name: off, subtle, neon, warm-film (or warm_film), crt.