pub struct GraphicsConfig {
pub max_frames: Option<u64>,
pub frames_in_flight: u32,
pub vsync: bool,
pub fps_cap: u32,
pub clear_color: [f32; 4],
pub shadow_map_size: u32,
pub shadow_update: ShadowUpdate,
pub shadow_distance: u32,
pub shadow_cascades: u32,
pub anisotropy: u32,
}Expand description
Rendering settings for the world: frame pacing, shadows, and clear colour. One per world. The GPU backend is chosen by the engine for the platform and is not user-configurable.
The shadow and anisotropy defaults describe the quality capable hardware
runs, not what every GPU runs: the Auto graphics quality preset resolves
the detected GPU into a ceiling that caps them tier by tier. Frame pacing
(vsync, fps_cap, frames_in_flight) is a user preference rather than a
quality tier, so no preset touches it.
{
"name": "gfx",
"type": "GraphicsConfig",
"args": { "clear_color": [0.1, 0.1, 0.15, 1.0], "frames_in_flight": 2 }
}Fields§
§max_frames: Option<u64>Cap the render loop at this many frames, then exit. Unset runs until the window is closed.
frames_in_flight: u32Preferred number of frames in flight (1-3). Higher can smooth pacing at the cost of input latency.
vsync: boolCap the frame rate to the display refresh (vsync). Defaults to false:
the render loop runs uncapped (DirectX presents with tearing allowed,
Vulkan uses a mailbox present mode), which is what a benchmark wants. Set
to true to lock presentation to the monitor refresh, eliminating tearing
and the wasted frames that never reach the screen.
fps_cap: u32Cap the frame rate to this many frames per second. 0 (default) leaves
the loop uncapped. The cap is a CPU-side frame pacer, so it composes with
vsync: the more restrictive of the two wins. Useful for limiting heat,
fan noise, and power draw, or matching a fixed refresh.
clear_color: [f32; 4]Background clear colour [r, g, b, a] in linear 0..1 space.
shadow_map_size: u32Shadow map resolution in texels. 4096 by default, capped by the quality
preset down to 1024 on the lowest tier. Set to 0 to disable shadows.
shadow_update: ShadowUpdateHow often shadow cascades are re-rendered. every_frame (default)
refreshes them all every frame; hybrid amortizes the far cascades
across frames. Only the top quality tier permits every_frame, so
everything below it runs hybrid.
shadow_distance: u32How far from the camera shadows are cast, in world units (e.g. 80). The cascades cover from the near plane out to this distance; a larger value shadows more of the scene but spreads the same shadow-map resolution over more area (softer, blockier shadows). Capped at the camera far plane.
shadow_cascades: u32Number of shadow cascades, 1 to 4 (4 is the default and the maximum).
More cascades keep distant shadows sharper by splitting the view range
into finer slices, at the cost of an extra shadow-map render per cascade;
fewer is cheaper but blockier far from the camera. The slice count covers
the same shadow_distance regardless.
anisotropy: u32Maximum anisotropic-filtering degree for the scene texture sampler
(albedo + normal maps), e.g. 8. Higher keeps textures viewed at a grazing
angle (floors, walls receding into the distance) sharp instead of blurring
along the minor axis, at a small sampling cost. 1 disables anisotropy
(plain trilinear). 16 by default, capped by the quality preset down to
4 on the lowest tier. Clamped to the GPU’s supported range (1..16) at
init.
Trait Implementations§
Source§impl Clone for GraphicsConfig
impl Clone for GraphicsConfig
Source§fn clone(&self) -> GraphicsConfig
fn clone(&self) -> GraphicsConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Component for GraphicsConfig
impl Component for GraphicsConfig
Source§const NAME: &'static str = "GraphicsConfig"
const NAME: &'static str = "GraphicsConfig"
Source§fn from_baked(bytes: &[u8]) -> Result<Self, CnResult>
fn from_baked(bytes: &[u8]) -> Result<Self, CnResult>
Source§fn inject_locator(&mut self, _locator: PayloadLocator)
fn inject_locator(&mut self, _locator: PayloadLocator)
Source§fn inject_name(&mut self, _id: AssetId)
fn inject_name(&mut self, _id: AssetId)
Source§impl ComponentSlot for GraphicsConfig
impl ComponentSlot for GraphicsConfig
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.