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<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 VolumetricFog
impl ComponentSlot for VolumetricFog
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.