#[repr(C)]pub struct LightUniforms {
pub directional: [DirectionalLightData; 4],
pub point: [PointLightData; 8],
pub num_directional: i32,
pub num_point: i32,
pub ambient_intensity: f32,
pub num_local_lights: i32,
}Expand description
All scene lights packed into a single GPU buffer pushed at fragment buffer(4). Must stay in sync with LightUniforms in every .metal shader.
Fields§
§directional: [DirectionalLightData; 4]Directional lights, the first num_directional entries live.
point: [PointLightData; 8]Point lights, the first num_point entries live.
num_directional: i32Live entries in directional.
num_point: i32Live entries in point.
ambient_intensity: f32Multiplier on the indirect (IBL / flat-fallback) ambient term in the main
pass, resolved from PostProcessConfig.ambient_intensity. 1.0 leaves the
physically derived ambient untouched; higher values lift fill in shadowed
areas the directional light cannot reach. Occupies the first of the two
trailing pad words, so the 400-byte layout is unchanged.
num_local_lights: i32Number of valid entries in the GpuLight storage buffer the forward pass
reads. Occupies the second trailing pad word, so the 400-byte layout is
unchanged. The raymarch / fog / probe paths ignore it and read num_point
against the fixed point array instead.
Implementations§
Source§impl LightUniforms
impl LightUniforms
Sourcepub const DEFAULT: LightUniforms
pub const DEFAULT: LightUniforms
Neutral directional sun; used when no Light components are declared.
Trait Implementations§
Source§impl Clone for LightUniforms
impl Clone for LightUniforms
Source§fn clone(&self) -> LightUniforms
fn clone(&self) -> LightUniforms
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more