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_intensity: f32§sun_casts_shadow: bool§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: f32§shadow_bias: f32§shadow_max_dist: f32§shadow_max_steps: u32§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