Skip to main content

PostProcessConfig

Struct PostProcessConfig 

Source
pub struct PostProcessConfig {
Show 32 fields pub bloom_intensity: f32, pub bloom_threshold: f32, pub bloom_knee: f32, pub exposure_ev: f32, pub vignette_strength: f32, pub lut_strength: f32, pub aa_mode: AaMode, pub ssao: bool, pub ssao_radius: f32, pub ssao_intensity: f32, pub ssr: bool, pub ssr_intensity: f32, pub ssr_max_distance: f32, pub ray_traced_reflections: bool, pub reflection_blur_resolution: ReflectionBlurResolution, pub indirect_lighting: IndirectLighting, pub ambient_intensity: f32, pub ssgi_intensity: f32, pub ssgi_max_distance: f32, pub ssgi_resolution: SsgiResolution, pub ssgi_rays: u32, pub ssgi_steps: u32, pub auto_exposure: bool, pub auto_exposure_min_ev: f32, pub auto_exposure_max_ev: f32, pub auto_exposure_speed: f32, pub hdr_display: bool, pub hdr_pq: bool, pub temporal_upscaling: bool, pub upscale_quality: UpscaleQuality, pub upscale_backend: UpscalerBackend, pub occlusion_two_pass: bool,
}
Expand description

Tunables for the post-process stack. One per world; the first declared instance wins. With no PostProcessConfig present, the defaults below are used.

The defaults describe the look on capable hardware: temporal anti-aliasing, ambient occlusion, reflections and a screen-space indirect bounce are all on. They are not what every GPU runs. The Auto graphics quality preset resolves the detected GPU into a performance ceiling that forces the expensive effects off tier by tier, so a world that authors nothing still runs well on a laptop and still looks its best on a workstation. A world that wants a cheaper look regardless of hardware turns the effects off here; a ceiling only ever reduces, so it cannot undo that.

Colour-LUT grading is a separate ColorLut asset; lut_strength here is the blend amount applied to whichever ColorLut the world declares.

When auto_exposure is on, the scene’s average brightness is measured each frame and exposure adapts toward a balanced mid-tone. The authored exposure_ev then acts as an additive bias (in stops) on top of the adapted value.

PostProcessConfig {
    bloom_intensity: 0.8,
    ..Default::default()
};

Fields§

§bloom_intensity: f32

Additive bloom contribution. 0 skips bloom entirely.

§bloom_threshold: f32

Brightness threshold for bloom. Pixels brighter than this contribute fully; pixels within bloom_knee below it ramp in softly.

§bloom_knee: f32

Width of the soft knee just below bloom_threshold.

§exposure_ev: f32

Exposure offset in photographic stops. Each +1 doubles scene brightness before bloom and tonemapping; 0 is neutral.

§vignette_strength: f32

Vignette strength in [0, 1]. 0 disables the corner darkening.

§lut_strength: f32

Colour-LUT blend in [0, 1]. Mixes the graded colour over the ungraded one by this amount. Only matters when the world declares a ColorLut; with none, grading is a no-op at any strength.

§aa_mode: AaMode

Anti-aliasing mode. fxaa applies a cheap composite-pass edge filter; taa (default) adds a temporal pass that jitters the projection and accumulates detail across frames for the cleanest edges, at the cost of a velocity pre-pass and a history buffer; off disables edge smoothing. Clamped to fxaa below the mid quality tier.

§ssao: bool

Screen-space ambient occlusion toggle. Darkens creases and contact areas where ambient light is occluded. On by default, forced off on the lowest quality tier.

§ssao_radius: f32

How far the ambient-occlusion search reaches for occluders, in world units. Larger values pick up broader, softer occlusion.

§ssao_intensity: f32

Ambient-occlusion strength, clamped to [0, 4]. 1.0 is the natural amount; higher values exaggerate the contact darkening.

§ssr: bool

Screen-space reflection toggle. Mixes reflected scene colour over glossy surfaces (water, polished floors). On by default, forced off below the high quality tier.

§ssr_intensity: f32

Reflection blend strength, clamped to [0, 1]. Scales the Fresnel-weighted reflection mixed over the base shading.

§ssr_max_distance: f32

How far a reflection reaches, in world units. Longer reaches catch more distant reflections, more coarsely.

§ray_traced_reflections: bool

Hardware ray-traced reflection toggle. When the GPU supports ray tracing, traces real reflection rays so off-screen geometry still appears, instead of the screen-space method. Reuses the ssr_intensity / ssr_max_distance tunables and takes precedence over ssr, falling back to it where ray tracing isn’t available. On by default; only the top quality tier permits it, so everything below falls back to ssr.

§reflection_blur_resolution: ReflectionBlurResolution

Internal resolution of the roughness-aware reflection blur the SSR / ray-traced reflection composite runs. half (default) blurs at a quarter of the pixels for a large saving and bilinearly upsamples; full blurs at native resolution; quarter is the cheapest. Smooth mirror surfaces stay sharp at any setting (the composite keeps the sharp reflection for low roughness). Only matters when ssr or ray_traced_reflections is on.

§indirect_lighting: IndirectLighting

Indirect-diffuse lighting source. ibl uses the environment map’s ambient alone. ssgi (default) adds a screen-space global-illumination pass on top, so nearby lit surfaces bleed colour onto one another; the environment ambient still covers the off-screen / sky fallback. Clamped back to ibl below the high quality tier.

§ambient_intensity: f32

Multiplier on the indirect (ambient / IBL) lighting term, clamped to [0, 16]. 1.0 (default) leaves the environment-derived ambient at its physical level. Raising it lifts fill light in areas the directional light cannot reach (shadowed facades, alleys) without brightening directly lit surfaces, which the sun already dominates. Scales the diffuse and specular IBL together, so reflections stay consistent with the brighter ambient. Useful for high-contrast exterior scenes where a strong sun would otherwise crush shadows to black.

§ssgi_intensity: f32

Indirect-bounce strength, clamped to [0, 4]. Scales the gathered indirect light added on top of the existing shading; 0 makes it a no-op. Only matters when indirect_lighting is ssgi.

§ssgi_max_distance: f32

How far the indirect-light gather reaches, in world units. A near-field effect, so it defaults well below ssr_max_distance. Only matters when indirect_lighting is ssgi.

§ssgi_resolution: SsgiResolution

Internal resolution of the SSGI gather. half (default) trades a little sharpness for a large performance saving; full is native; quarter is the cheapest. Only matters when indirect_lighting is ssgi.

§ssgi_rays: u32

Hemisphere rays cast per pixel by the SSGI gather, clamped to [1, 32]. More rays reduce noise at a higher cost. Only matters when indirect_lighting is ssgi.

§ssgi_steps: u32

Ray-march samples per SSGI ray, clamped to [1, 64]. More samples catch finer occlusion at a higher cost. Only matters when indirect_lighting is ssgi.

§auto_exposure: bool

Auto-exposure toggle. Adapts exposure each frame toward a balanced mid-tone. The authored exposure_ev then acts as an additive bias in stops on top of the adapted value.

§auto_exposure_min_ev: f32

Lower bound on the adapted exposure (EV). The exposure_ev bias is applied before this clamp.

§auto_exposure_max_ev: f32

Upper bound on the adapted exposure (EV).

§auto_exposure_speed: f32

How quickly exposure chases a new target (per second). Higher converges faster but can pump under flickering content; 1-3 is comfortable.

§hdr_display: bool

HDR display output toggle. On a capable display, emits extended-range HDR instead of the standard tonemapped output. Falls back to standard output when the display or platform doesn’t support HDR.

§hdr_pq: bool

PQ (HDR10) output mode. When true, and hdr_display is on, and the display has HDR headroom, output is PQ-encoded for HDR10 panels. No effect when hdr_display is off.

§temporal_upscaling: bool

Temporal upscaling toggle. Renders the 3D scene at a lower resolution (set by upscale_quality) and reconstructs a full-resolution image, trading some sharpness for performance. Replaces TAA while on (the taa flag is ignored).

§upscale_quality: UpscaleQuality

Render-scale preset for temporal_upscaling; each step progressively lowers the internal resolution. No effect when temporal_upscaling is off.

§upscale_backend: UpscalerBackend

Which upscaler backend temporal_upscaling uses. auto (default) picks the best available at runtime (DLSS on NVIDIA RTX, else XeSS, else FSR3); fsr3 / dlss / xess request a specific one and fall back when it is unavailable on the current GPU or build. No effect when temporal_upscaling is off. DLSS and XeSS are DirectX-only.

§occlusion_two_pass: bool

Two-pass occlusion culling toggle. Reduces objects popping in a frame late when they’re revealed by camera or occluder motion, at the cost of extra culling work each frame. Needs the bindless GPU-cull path.

Trait Implementations§

Source§

impl Clone for PostProcessConfig

Source§

fn clone(&self) -> PostProcessConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Component for PostProcessConfig

Source§

const NAME: &'static str = "PostProcessConfig"

The registry name a world authors this component under.
Source§

fn from_baked(bytes: &[u8]) -> Result<Self, CnResult>

Reconstruct this component from a blob record, whose bytes are the serialized runtime component (cook already ran the asset -> component translation). The default rejects: runtime-only components are never stored in a blob, so only loadable types provide an implementation.
Source§

fn inject_locator(&mut self, _locator: PayloadLocator)

Called after construction to inject the payload locator from the blob def. Only meaningful for components with a compiled payload. The default implementation does nothing (correct for most components).
Source§

fn inject_name(&mut self, _id: AssetId)

Called after construction to inject the asset’s identity from the blob def. Only meaningful for components that look themselves up by id at runtime. The default implementation does nothing.
Source§

impl ComponentSlot for PostProcessConfig

Source§

const DISCRIMINANT: u8

The component type’s stable id, used as its ComponentId.
Source§

fn slot(s: &ComponentStorage) -> &Column<Self>

Borrow this type’s column out of the storage.
Source§

fn slot_mut(s: &mut ComponentStorage) -> &mut Column<Self>

Mutably borrow this type’s column out of the storage.
Source§

impl Debug for PostProcessConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PostProcessConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for PostProcessConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<PostProcessConfig> for ComponentAsset

Source§

fn from(c: PostProcessConfig) -> Self

Converts to this type from the input type.
Source§

impl PostProcessResolve for PostProcessConfig

Source§

fn resolve(&self) -> PostProcessTunables

Resolve the authored fields into the GPU-facing PostProcessTunables: clamps each tunable and converts exposure_ev (stops) into the linear multiplier the shaders expect. The composite’s display-output flags are not authored, so they are absent here: the backend adds them to the full PostProcessParams once it has negotiated EDR support with the display.
Source§

fn ambient_intensity(&self) -> f32

Clamp the authored ambient_intensity to a safe [0, 16] multiplier the backend folds into LightUniforms to scale the indirect (ambient / IBL) term.
Source§

fn reflection_blur_divisor(&self) -> u32

Per-axis divisor for the roughness-aware reflection blur target, resolved from reflection_blur_resolution. Always at least 1.
Source§

fn ssao_settings(&self) -> Option<SsaoSettings>

Resolve the SSAO tunables into clamped SsaoSettings, or None when the ssao toggle is off so the backend can skip the SSAO passes entirely.
Source§

fn ssr_settings(&self) -> Option<SsrSettings>

Resolve the SSR tunables into clamped SsrSettings, or None when the ssr toggle is off.
Source§

fn rt_reflection_settings(&self) -> Option<RtReflectionSettings>

Resolve the ray-traced-reflection tunables into clamped RtReflectionSettings, or None when ray_traced_reflections is off. Reuses the SSR intensity / distance fields; the backend additionally gates on GPU ray-tracing support.
Source§

fn ssgi_settings(&self) -> Option<SsgiSettings>

Resolve the SSGI tunables into clamped SsgiSettings, or None when indirect_lighting is not Ssgi so the backend can skip the SSGI passes.
Source§

fn auto_exposure_settings(&self) -> Option<AutoExposureSettings>

Resolve the auto-exposure tunables into clamped AutoExposureSettings, or None when the toggle is off so the backend can skip the histogram passes.
Source§

impl RuntimeComponent for PostProcessConfig

Source§

impl Serialize for PostProcessConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.