#[derive(Clone, Copy, Debug, PartialEq)]
pub struct DirectionalLight {
pub direction: [f32; 3],
pub color: [f32; 3],
pub intensity: f32,
pub casts_shadow: bool,
}
impl Default for DirectionalLight {
fn default() -> Self {
Self {
direction: [0.0, 0.0, 1.0],
color: [1.0; 3],
intensity: 1.0,
casts_shadow: false,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct PointLight {
pub position: [f32; 3],
pub color: [f32; 3],
pub intensity: f32,
pub radius: f32,
pub casts_shadow: bool,
}
impl Default for PointLight {
fn default() -> Self {
Self {
position: [0.0; 3],
color: [1.0; 3],
intensity: 1.0,
radius: 32.0,
casts_shadow: false,
}
}
}
#[derive(Clone, Copy, Debug)]
pub struct LightRig<'a> {
pub sun: Option<DirectionalLight>,
pub points: &'a [PointLight],
pub ambient: [f32; 3],
pub shadow_strength: f32,
pub shadow_bias_voxels: f32,
pub shadow_max_dist: f32,
pub bands: u32,
pub shadow_tint: [f32; 3],
}
impl Default for LightRig<'_> {
fn default() -> Self {
Self {
sun: None,
points: &[],
ambient: [1.0; 3],
shadow_strength: 0.7,
shadow_bias_voxels: 1.5,
shadow_max_dist: 512.0,
bands: 0,
shadow_tint: [0.12, 0.14, 0.2],
}
}
}