pub struct StreamingConfig {
pub texture_budget: u32,
pub texture_cap: u32,
pub mesh_budget: u32,
pub mesh_cap: u32,
pub texture_budget_mb: u32,
pub mesh_budget_mb: u32,
}Expand description
Enables and tunes asset streaming.
When no StreamingConfig is declared, streaming is off and every texture and
mesh is loaded up front. When one is present, textures and static mesh
geometry load in gradually after startup: each frame the nearest not-yet-
loaded items are brought in, up to a per-frame budget, prioritised by camera
distance. Once more than the cap would be loaded at once, the farthest are
dropped to make room.
Texture streaming covers the colour and normal-map textures (each capped
independently via texture_budget / texture_cap). Mesh streaming covers
static geometry; the skybox, rooms, and moving props always stay loaded.
Fields§
§texture_budget: u32Maximum number of textures whose load is started per frame, applied independently to the colour and normal-map pools. A low value spreads the cost over more frames.
texture_cap: u32Maximum number of textures kept loaded at once, applied independently to the colour and normal-map pools. When exceeded, the farthest-from-camera textures are dropped.
mesh_budget: u32Maximum number of mesh regions whose load is started per frame. A low value spreads the cost over more frames.
mesh_cap: u32Maximum number of meshes kept loaded at once. When exceeded, the farthest-from-camera meshes are dropped.
texture_budget_mb: u32Resident-texture memory budget in mebibytes, spanning the colour and
normal-map pools together. Once resident textures exceed it the
farthest-from-camera ones are dropped, so nearer textures always win the
space. 0 (the default) derives the budget from the GPU’s reported
memory instead. texture_cap still applies as a hard item-count ceiling.
mesh_budget_mb: u32Resident-mesh memory budget in mebibytes. Once resident meshes exceed it
the farthest-from-camera ones are dropped. 0 (the default) derives the
budget from the GPU’s reported memory instead. mesh_cap still applies
as a hard item-count ceiling.
Implementations§
Source§impl StreamingConfig
impl StreamingConfig
Trait Implementations§
Source§impl Clone for StreamingConfig
impl Clone for StreamingConfig
Source§fn clone(&self) -> StreamingConfig
fn clone(&self) -> StreamingConfig
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 StreamingConfig
impl Component for StreamingConfig
Source§const NAME: &'static str = "StreamingConfig"
const NAME: &'static str = "StreamingConfig"
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 StreamingConfig
impl ComponentSlot for StreamingConfig
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.