pub struct SceneLights {Show 15 fields
pub enabled: bool,
pub grid_sun_dirs: Vec<[f32; 3]>,
pub sun_color: [f32; 3],
pub sun_intensity: f32,
pub sun_casts_shadow: bool,
pub grid_point_lights: Vec<Vec<GpuLight>>,
pub ambient: [f32; 3],
pub shadow_strength: f32,
pub shadow_bias: f32,
pub shadow_max_dist: f32,
pub shadow_max_steps: u32,
pub world_sun_dir: [f32; 3],
pub world_points: Vec<GpuLight>,
pub style_bands: u32,
pub shadow_tint: [f32; 3],
}Expand description
The whole per-frame light environment, already transformed per grid.
grid_sun_dirs and grid_point_lights are indexed by grid (outer
length == grid_count); empty ⇒ that light type is off. Set each frame
via GpuRenderer::set_scene_lights; Default = no lights (the
pre-DL render).
Fields§
§enabled: boolWhether a dynamic-lighting rig is active this frame. false (the
default) ⇒ the shader takes the unchanged baked-only path
(byte-identical to pre-DL). true ⇒ the lit path runs (ambient
term + sun + point lights), even with no sun/points set, so the
ambient multiplier still applies.
grid_sun_dirs: Vec<[f32; 3]>Per-grid unit direction to the sun (grid-local). Empty ⇒ no sun.
sun_color: [f32; 3]Sun colour, linear RGB 0..1. The shader’s sun term is
albedo · sun_color · sun_intensity · N·L · shadow.
sun_intensity: f32Scalar multiplier on Self::sun_color; 0.0 blacks the sun
out even when grid_sun_dirs is set.
sun_casts_shadow: boolWhether the sun marches shadow rays. When true the sun takes
the first slot of the MAX_SHADOW_CASTERS budget.
grid_point_lights: Vec<Vec<GpuLight>>Per-grid point lights (grid-local). Outer len == grid_count; the
inner len (the point count) is the same for every grid.
ambient: [f32; 3]Multiplier on the baked ambient byte.
shadow_strength: f32Fraction of a caster’s light removed at shadowed hits, 0..=1
(1.0 = fully black shadows, 0.0 = shadows invisible). The
shader applies in_shadow = 1 - shadow_strength; the facade
default is 0.7.
shadow_bias: f32Shadow-ray origin offset along the hit’s surface normal, in
voxel units — kills self-shadow acne. The facade passes
LightRig::shadow_bias_voxels (default 1.5).
shadow_max_dist: f32Length cap for sun shadow rays, world/voxel units (facade
default 512). Point-light shadow rays stop at the light itself
instead.
shadow_max_steps: u32Hard cap on voxel steps per shadow ray so the occlusion march
always terminates (the facade passes 256). Past the cap the
point is treated as unshadowed.
world_sun_dir: [f32; 3]DL.4 — world-space unit direction to the sun, for the sprite
pass (sprites render in world space, not grid-local). [0;3] ⇒ no
sun. Empty grid_sun_dirs and a zero world_sun_dir both mean
“no sun” for their respective passes.
world_points: Vec<GpuLight>DL.4 — world-space point lights for the sprite pass (positions in world coords; same colour/intensity/radius as the per-grid copies).
style_bands: u32DL.6 — stylized cel banding: 0 = smooth, ≥1 = quantize the
diffuse to bands + 1 levels + gradient-map the sun key.
shadow_tint: [f32; 3]DL.6 — cool shadow/ambient tint (the stylized ramp’s unlit end).
Trait Implementations§
Source§impl Clone for SceneLights
impl Clone for SceneLights
Source§fn clone(&self) -> SceneLights
fn clone(&self) -> SceneLights
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more