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<GraphicsConfig, CnResult>
fn from_baked(bytes: &[u8]) -> Result<GraphicsConfig, 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.Source§fn slot(s: &ComponentStorage) -> &Column<GraphicsConfig>
fn slot(s: &ComponentStorage) -> &Column<GraphicsConfig>
Source§fn slot_mut(s: &mut ComponentStorage) -> &mut Column<GraphicsConfig>
fn slot_mut(s: &mut ComponentStorage) -> &mut Column<GraphicsConfig>
Source§impl Debug for GraphicsConfig
impl Debug for GraphicsConfig
Source§impl Default for GraphicsConfig
impl Default for GraphicsConfig
Source§fn default() -> GraphicsConfig
fn default() -> GraphicsConfig
Source§impl<'de> Deserialize<'de> for GraphicsConfigwhere
GraphicsConfig: Default,
impl<'de> Deserialize<'de> for GraphicsConfigwhere
GraphicsConfig: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GraphicsConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GraphicsConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<GraphicsConfig> for ComponentAsset
impl From<GraphicsConfig> for ComponentAsset
Source§fn from(c: GraphicsConfig) -> ComponentAsset
fn from(c: GraphicsConfig) -> ComponentAsset
impl RuntimeComponent for GraphicsConfig
Source§impl Serialize for GraphicsConfig
impl Serialize for GraphicsConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for GraphicsConfig
impl RefUnwindSafe for GraphicsConfig
impl Send for GraphicsConfig
impl Sync for GraphicsConfig
impl Unpin for GraphicsConfig
impl UnsafeUnpin for GraphicsConfig
impl UnwindSafe for GraphicsConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().