pub struct CpuLights<'a> {Show 13 fields
pub enabled: bool,
pub sun: bool,
pub sun_dir: [f32; 3],
pub sun_color: [f32; 3],
pub sun_intensity: f32,
pub sun_casts_shadow: bool,
pub points: &'a [CpuPointLight],
pub ambient: [f32; 3],
pub bands: u32,
pub shadow_tint: [f32; 3],
pub shadow_strength: f32,
pub shadow_bias: f32,
pub shadow_max_dist: f32,
}Expand description
CPU.1 — the per-frame dynamic-light environment for one grid (grid-local).
Mirror of the GPU shade_lit inputs. enabled == false (the default)
keeps the baked-byte path. CPU.2 adds hard voxel shadows (sun + flagged
point lights) via a per-(voxel,face) shadow march; shadow_strength == 0
(the Default) leaves the lighting diffuse-only.
Fields§
§enabled: boolWhether dynamic lighting is active this frame (else the baked path).
sun: boolWhether the sun is present.
sun_dir: [f32; 3]Grid-local unit direction to the sun.
sun_color: [f32; 3]§sun_intensity: f32§sun_casts_shadow: boolCPU.2 — whether the sun casts a hard shadow.
points: &'a [CpuPointLight]Grid-local point lights.
ambient: [f32; 3]Ambient multiplier on the baked byte (smooth mode’s fill).
bands: u32Cel band count: 0 = smooth, ≥1 = quantize + gradient-map (stylized).
shadow_tint: [f32; 3]Stylized ramp’s cool unlit-end tint (used when bands > 0).
shadow_strength: f32CPU.2 — fraction of a caster’s light removed where a shadow ray is
occluded (0 ⇒ shadows off, 1 ⇒ full black). A shadowed sample
keeps 1 - shadow_strength of that caster.
shadow_bias: f32CPU.2 — shadow-ray origin bias along the surface normal, voxel units (kills self-shadow acne). ~1.5 is a good default.
shadow_max_dist: f32CPU.2 — sun shadow-ray length cap, voxel units (point-light rays stop at the light instead).
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for CpuLights<'a>
impl<'a> RefUnwindSafe for CpuLights<'a>
impl<'a> Send for CpuLights<'a>
impl<'a> Sync for CpuLights<'a>
impl<'a> Unpin for CpuLights<'a>
impl<'a> UnsafeUnpin for CpuLights<'a>
impl<'a> UnwindSafe for CpuLights<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more