Skip to main content

RenderConfig

Struct RenderConfig 

Source
pub struct RenderConfig {
Show 44 fields pub bloom_enabled: bool, pub bloom_intensity: f32, pub bloom_radius: f32, pub distortion_enabled: bool, pub motion_blur_enabled: bool, pub motion_blur_samples: u32, pub chromatic_aberration: f32, pub film_grain: f32, pub scanlines_enabled: bool, pub scanline_intensity: f32, pub exposure: f32, pub tonemap: f32, pub halation: f32, pub saturation: f32, pub contrast: f32, pub brightness: f32, pub vignette: f32, pub vignette_softness: f32, pub tint: [f32; 3], pub lift: [f32; 3], pub gain: [f32; 3], pub bloom_threshold: f32, pub bloom_knee: f32, pub anamorphic: f32, pub sharpen: f32, pub dither: f32, pub barrel: f32, pub font_size: u32, pub fullscreen: bool, pub render_scale: f32, pub particle_multiplier: f32, pub shadow_quality: ShadowQuality, pub antialiasing: bool, pub color_depth: u8, pub global_illumination: bool, pub volumetric_fog: bool, pub indirect_light: f32, pub light_shafts: f32, pub lens_flare: f32, pub shake_pixels: f32, pub fxaa: bool, pub persistence: f32, pub vsync: bool, pub world_ui_in_scene: bool,
}

Fields§

§bloom_enabled: bool§bloom_intensity: f32§bloom_radius: f32

Bloom radius in pixels (higher = wider glow).

§distortion_enabled: bool§motion_blur_enabled: bool§motion_blur_samples: u32

Motion blur sample count (2-16).

§chromatic_aberration: f32§film_grain: f32§scanlines_enabled: bool§scanline_intensity: f32§exposure: f32

Linear exposure, applied before the tonemap. 1.0 is neutral.

§tonemap: f32

How much of the filmic curve to apply, 0.0 to 1.0.

Without it the image is clipped rather than rolled off, which is what makes a rendered frame look rendered.

§halation: f32

Warm bleed around bright edges, the way film halates. 0.0 to ~0.5.

§saturation: f32§contrast: f32§brightness: f32§vignette: f32

Strength of the corner darkening, 0.0 to 1.0.

§vignette_softness: f32

Where the vignette starts, as a fraction of the way to the corner.

§tint: [f32; 3]

Colour cast, multiplied over everything.

§lift: [f32; 3]

Shadows, lifted toward this colour.

§gain: [f32; 3]

Highlights, multiplied by this colour.

§bloom_threshold: f32

Nothing dimmer than this blooms. 0.0 blooms everything.

§bloom_knee: f32

How soft the edge of that threshold is.

§anamorphic: f32

Horizontal light streaking, the way anamorphic glass flares. 0.0 off.

§sharpen: f32

Unsharp mask after the tonemap, to put back the edge bloom takes off.

§dither: f32

Ordered dither before output, in 8-bit steps.

This engine renders very dark scenes, and a dark gradient in eight bits per channel bands visibly. A quarter-step of ordered noise costs nothing and removes it.

§barrel: f32

Barrel distortion, as a fraction of the frame. Small values only.

§font_size: u32§fullscreen: bool§render_scale: f32

Render scale (1.0 = native, 0.5 = half res).

§particle_multiplier: f32

Particle system multiplier (1.0 = full, 0.5 = half particles).

§shadow_quality: ShadowQuality§antialiasing: bool

Enable anti-aliasing (FXAA approximation for terminal renderer).

§color_depth: u8

Color depth per channel for dithering: 8, 16, or 32.

§global_illumination: bool

Voxel-cone global illumination: voxelise the scene, inject light, propagate. Worth it for a lit 3D scene and pure cost for anything else.

This used to run unconditionally, every frame, whatever was on screen — which meant a game drawing its whole interface in the screen-space UI layer paid for a global illumination solve it could never see.

§volumetric_fog: bool

Volumetric fog. Same story: a real effect, and a real cost, that a scene with nothing in it cannot benefit from.

§indirect_light: f32

Screen-space indirect light: how strongly matter near something bright is lit by it, in that thing’s colour. 0.0 off; 0.5 to 1.5 is a lit room.

§light_shafts: f32

Radial light shafts from the source the game sets on engine.fx. 0.0 off; the source’s own strength scales it further.

§lens_flare: f32

Lens flare ghosts and halo off anything that blooms. 0.0 off; 0.1 to 0.4 is a visible lens without being a screensaver.

§shake_pixels: f32

How far, in pixels, the world pass moves at full camera trauma. The HUD does not move. 0.0 turns screen shake off for the world pass.

§fxaa: bool

Anti-aliasing on the finished frame, between the composite and the HUD. A real FXAA pass, not the terminal approximation antialiasing names.

§persistence: f32

Motion trails. The fraction of the previous frame’s scene that survives into this one, 0.0 to about 0.9. Applies to the scene and the UI world pass, never to the HUD.

§vsync: bool

Wait for the display’s vertical refresh before presenting. Off, the loop runs as fast as the GPU allows, which burns power and makes every time-based effect run at whatever rate the machine happens to.

§world_ui_in_scene: bool

Whether the UI layer’s world pass is painted into the scene buffer. Off, every UI command paints in the HUD pass after post-processing, which is how the layer behaved before the world pass existed.

Implementations§

Source§

impl RenderConfig

Source

pub fn validate(&mut self)

Trait Implementations§

Source§

impl Clone for RenderConfig

Source§

fn clone(&self) -> Self

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 Debug for RenderConfig

Source§

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

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

impl Default for RenderConfig

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for RenderConfig

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 Serialize for RenderConfig

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Downcast for T
where T: Any,

Source§

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>

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)

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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more