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<StreamingConfig, CnResult>
fn from_baked(bytes: &[u8]) -> Result<StreamingConfig, 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.Source§fn slot(s: &ComponentStorage) -> &Column<StreamingConfig>
fn slot(s: &ComponentStorage) -> &Column<StreamingConfig>
Source§fn slot_mut(s: &mut ComponentStorage) -> &mut Column<StreamingConfig>
fn slot_mut(s: &mut ComponentStorage) -> &mut Column<StreamingConfig>
Source§impl Debug for StreamingConfig
impl Debug for StreamingConfig
Source§impl Default for StreamingConfig
impl Default for StreamingConfig
Source§fn default() -> StreamingConfig
fn default() -> StreamingConfig
Source§impl<'de> Deserialize<'de> for StreamingConfigwhere
StreamingConfig: Default,
impl<'de> Deserialize<'de> for StreamingConfigwhere
StreamingConfig: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<StreamingConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<StreamingConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<StreamingConfig> for ComponentAsset
impl From<StreamingConfig> for ComponentAsset
Source§fn from(c: StreamingConfig) -> ComponentAsset
fn from(c: StreamingConfig) -> ComponentAsset
impl RuntimeComponent for StreamingConfig
Source§impl Serialize for StreamingConfig
impl Serialize for StreamingConfig
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 StreamingConfig
impl RefUnwindSafe for StreamingConfig
impl Send for StreamingConfig
impl Sync for StreamingConfig
impl Unpin for StreamingConfig
impl UnsafeUnpin for StreamingConfig
impl UnwindSafe for StreamingConfig
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().