pub struct VolumetricFog {
pub enabled: bool,
pub color: [f32; 3],
pub density: f32,
pub height_falloff: f32,
pub height_reference: f32,
pub max_distance: f32,
pub phase_g: f32,
pub ambient: f32,
}Expand description
Environmental volumetric fog: a single lit medium that wraps the scene, thicker near the ground and thinning with height, with extra glow around the sun.
Only one VolumetricFog is honoured: the first declared instance wins;
later instances are silently dropped. With none declared, there is no fog.
VolumetricFog {
density: 0.08,
color: [0.75, 0.82, 0.95],
height_falloff: 0.18,
max_distance: 160.0,
phase_g: 0.5,
..Default::default()
};Fields§
§enabled: boolMaster toggle. false disables the fog even when this asset is present.
color: [f32; 3]Linear-space RGB tint of the fog: the colour the camera sees in the far distance.
density: f32Base thickness of the fog at height_reference (per world unit). Higher
is thicker. Floored at 0.
height_falloff: f32How quickly the fog thins with height above height_reference. 0 keeps
it uniform; larger values pin it to the ground.
height_reference: f32World-space Y at which the fog reaches full density. It thickens below
this height and thins above it.
max_distance: f32Maximum distance the fog covers from the camera, in world units. Past this, distant geometry stays clear.
phase_g: f32Sun-glow anisotropy in (-1, 1). Positive values concentrate brightness
around the sun (haloes), negative values scatter away from it, 0 is
uniform.
ambient: f32Constant ambient brightness so the fog keeps some colour in shaded areas.
Trait Implementations§
Source§impl Clone for VolumetricFog
impl Clone for VolumetricFog
Source§fn clone(&self) -> VolumetricFog
fn clone(&self) -> VolumetricFog
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 VolumetricFog
impl Component for VolumetricFog
Source§const NAME: &'static str = "VolumetricFog"
const NAME: &'static str = "VolumetricFog"
Source§fn from_baked(bytes: &[u8]) -> Result<VolumetricFog, CnResult>
fn from_baked(bytes: &[u8]) -> Result<VolumetricFog, 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 VolumetricFog
impl ComponentSlot for VolumetricFog
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.Source§fn slot(s: &ComponentStorage) -> &Column<VolumetricFog>
fn slot(s: &ComponentStorage) -> &Column<VolumetricFog>
Source§fn slot_mut(s: &mut ComponentStorage) -> &mut Column<VolumetricFog>
fn slot_mut(s: &mut ComponentStorage) -> &mut Column<VolumetricFog>
Source§impl Debug for VolumetricFog
impl Debug for VolumetricFog
Source§impl Default for VolumetricFog
impl Default for VolumetricFog
Source§fn default() -> VolumetricFog
fn default() -> VolumetricFog
Source§impl<'de> Deserialize<'de> for VolumetricFogwhere
VolumetricFog: Default,
impl<'de> Deserialize<'de> for VolumetricFogwhere
VolumetricFog: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<VolumetricFog, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<VolumetricFog, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<VolumetricFog> for ComponentAsset
impl From<VolumetricFog> for ComponentAsset
Source§fn from(c: VolumetricFog) -> ComponentAsset
fn from(c: VolumetricFog) -> ComponentAsset
impl RuntimeComponent for VolumetricFog
Source§impl Serialize for VolumetricFog
impl Serialize for VolumetricFog
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 VolumetricFog
impl RefUnwindSafe for VolumetricFog
impl Send for VolumetricFog
impl Sync for VolumetricFog
impl Unpin for VolumetricFog
impl UnsafeUnpin for VolumetricFog
impl UnwindSafe for VolumetricFog
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().