extern crate nalgebra as na;
extern crate nalgebra_glm as glm;
pub struct LightEmit {
pub color: na::Vector3<f32>,
pub intensity: f32,
pub range: f32,
pub radius: f32, pub outer_angle: f32,
pub inner_angle: f32,
}
impl Default for LightEmit {
fn default() -> LightEmit {
Self {
color: na::Vector3::<f32>::new(1.0, 1.0, 1.0),
intensity: 30.0,
range: 100.0,
radius: 0.1,
outer_angle: std::f32::consts::PI / 2.0, inner_angle: 0.0,
}
}
}
pub struct ShadowCaster {
pub shadow_res: u32,
pub shadow_bias_fixed: f32,
pub shadow_bias: f32,
pub shadow_bias_normal: f32,
}
impl Default for ShadowCaster {
fn default() -> Self {
Self {
shadow_res: 2048,
shadow_bias_fixed: 2e-6,
shadow_bias: 2e-6,
shadow_bias_normal: 2e-6,
}
}
}
pub struct ShadowMap {
pub tex_depth: easy_wgpu::texture::Texture,
}
#[cfg(target_arch = "wasm32")]
unsafe impl Send for ShadowMap {}
#[cfg(target_arch = "wasm32")]
unsafe impl Sync for ShadowMap {}