use super::*;
#[derive(Clone, Copy, Data, Debug, PartialEq)]
pub struct CsmCascadeSlice3D {
#[get(type(copy))]
pub(crate) near_depth: f32,
#[get(type(copy))]
pub(crate) far_depth: f32,
#[get(type(copy))]
pub(crate) world_center: Vec3,
#[get(type(copy))]
pub(crate) snapped_center: Vec3,
#[get(type(copy))]
pub(crate) half_extent: f32,
#[get(type(copy))]
pub(crate) texel_size: f32,
#[get(type(copy))]
pub(crate) light_view: Mat4,
#[get(type(copy))]
pub(crate) light_proj: Mat4,
#[get(type(copy))]
pub(crate) light_view_proj: Mat4,
}
#[derive(Clone, Copy, Data, Debug, PartialEq)]
pub struct CsmCascadeSplits {
#[get(type(copy))]
pub(crate) cascade_count: usize,
#[get(type(copy))]
pub(crate) lambda: f32,
#[get(type(copy))]
pub(crate) near_plane: f32,
#[get(type(copy))]
pub(crate) far_plane: f32,
#[get(type(copy))]
pub(crate) shadow_map_resolution: u32,
#[get(type(copy))]
pub(crate) slices: [CsmCascadeSlice3D; CSM_MAX_CASCADES],
}
#[derive(Clone, Copy, Data, Debug, PartialEq)]
pub struct RigDirectionalLight3D {
#[get(type(copy))]
pub(crate) direction: Vec3,
#[get(type(copy))]
pub(crate) color: Vec3,
#[get(type(copy))]
pub(crate) illuminance: f32,
#[get(type(copy))]
pub(crate) angular_radius_rad: f32,
#[get(type(copy))]
pub(crate) cast_shadows: bool,
#[get(type(copy))]
pub(crate) shadow_bias: f32,
#[get(type(copy))]
pub(crate) cascade_count: usize,
#[get(type(copy))]
pub(crate) csm_lambda: f32,
#[get(type(copy))]
pub(crate) max_shadow_distance: f32,
}
#[derive(Clone, Copy, Data, Debug, New, PartialEq)]
pub struct CubeShadowFace3D {
#[get(type(copy))]
pub(crate) face_index: u8,
#[get(type(copy))]
pub(crate) forward: Vec3,
#[get(type(copy))]
pub(crate) up: Vec3,
#[get(type(copy))]
pub(crate) view_proj: Mat4,
#[get(type(copy))]
pub(crate) frustum: Frustum3D,
}
#[derive(Clone, Copy, Data, Debug, PartialEq)]
pub struct RigPointLight3D {
#[get(type(copy))]
pub(crate) position: Vec3,
#[get(type(copy))]
pub(crate) color: Vec3,
#[get(type(copy))]
pub(crate) intensity: f32,
#[get(type(copy))]
pub(crate) source_radius: f32,
#[get(type(copy))]
pub(crate) range: f32,
#[get(type(copy))]
pub(crate) cast_shadows: bool,
#[get(type(copy))]
pub(crate) shadow_near: f32,
}
#[derive(Clone, Data, Debug, PartialEq)]
pub struct RigSpotLight3D {
#[get(type(copy))]
pub(crate) position: Vec3,
#[get(type(copy))]
pub(crate) direction: Vec3,
#[get(type(copy))]
pub(crate) up_hint: Vec3,
#[get(type(copy))]
pub(crate) color: Vec3,
#[get(type(copy))]
pub(crate) intensity: f32,
#[get(type(copy))]
pub(crate) source_radius: f32,
#[get(type(copy))]
pub(crate) range: f32,
#[get(type(copy))]
pub(crate) inner_angle_rad: f32,
#[get(type(copy))]
pub(crate) outer_angle_rad: f32,
#[get(type(copy))]
pub(crate) cast_shadows: bool,
pub(crate) cookie: SpotCookieMask,
}
#[derive(Clone, Copy, Data, Debug, PartialEq)]
pub struct RigAreaLight3D {
#[get(type(copy))]
pub(crate) position: Vec3,
#[get(type(copy))]
pub(crate) direction: Vec3,
#[get(type(copy))]
pub(crate) right: Vec3,
#[get(type(copy))]
pub(crate) up: Vec3,
#[get(type(copy))]
pub(crate) color: Vec3,
#[get(type(copy))]
pub(crate) intensity: f32,
#[get(type(copy))]
pub(crate) width: f32,
#[get(type(copy))]
pub(crate) height: f32,
#[get(type(copy))]
pub(crate) range: f32,
#[get(type(copy))]
pub(crate) shape: RigAreaLightShape3D,
#[get(type(copy))]
pub(crate) two_sided: bool,
}
#[derive(Clone, Copy, Data, Debug, New, PartialEq)]
pub struct EmissiveTriangle3D {
#[get(type(copy))]
pub(crate) v0: Vec3,
#[get(type(copy))]
pub(crate) v1: Vec3,
#[get(type(copy))]
pub(crate) v2: Vec3,
#[get(type(copy))]
pub(crate) normal: Vec3,
#[get(type(copy))]
pub(crate) area: f32,
#[get(type(copy))]
pub(crate) emissive_radiance: Vec3,
}
#[derive(Clone, Copy, Data, Debug, New, PartialEq)]
pub struct EmissiveMeshSample3D {
#[get(type(copy))]
pub(crate) position: Vec3,
#[get(type(copy))]
pub(crate) normal: Vec3,
#[get(type(copy))]
pub(crate) radiance: Vec3,
#[get(type(copy))]
pub(crate) pdf_area: f32,
}
#[derive(Clone, Data, Debug, PartialEq)]
pub struct EmissiveMeshLight3D {
pub(crate) triangles: Vec<EmissiveTriangle3D>,
pub(crate) cdf: Vec<f32>,
#[get(type(copy))]
pub(crate) total_area: f32,
#[get(type(copy))]
pub(crate) total_flux_weight: f32,
#[get(type(copy))]
pub(crate) bounds: AxisAlignedBox3D,
#[get(type(copy))]
pub(crate) range: f32,
#[get(type(copy))]
pub(crate) two_sided: bool,
}
#[derive(Clone, Data, Debug, PartialEq)]
pub struct LightRig3D {
pub(crate) directional_lights: Vec<RigDirectionalLight3D>,
pub(crate) point_lights: Vec<RigPointLight3D>,
pub(crate) spot_lights: Vec<RigSpotLight3D>,
pub(crate) area_lights: Vec<RigAreaLight3D>,
pub(crate) emissive_meshes: Vec<EmissiveMeshLight3D>,
#[get(type(copy))]
pub(crate) ambient_color: Vec3,
#[get(type(copy))]
pub(crate) ambient_intensity: f32,
}
#[derive(Clone, Copy, Data, Debug, Default, New, PartialEq)]
pub struct ClusteredLightRef {
#[get(type(copy))]
pub(crate) kind: ClusteredLightKind,
#[get(type(copy))]
pub(crate) index: u32,
#[get(type(copy))]
pub(crate) bounding_center: Vec3,
#[get(type(copy))]
pub(crate) bounding_radius: f32,
}
#[derive(Clone, Data, Debug, PartialEq)]
pub struct ForwardPlusLightGrid {
#[get(type(copy))]
pub(crate) nx: usize,
#[get(type(copy))]
pub(crate) ny: usize,
#[get(type(copy))]
pub(crate) nz: usize,
#[get(type(copy))]
pub(crate) max_lights_per_cluster: usize,
#[get(type(copy))]
pub(crate) near_plane: f32,
#[get(type(copy))]
pub(crate) far_plane: f32,
#[get(type(copy))]
pub(crate) tan_half_y: f32,
#[get(type(copy))]
pub(crate) tan_half_x: f32,
#[get(type(copy))]
pub(crate) log_depth_scale: f32,
#[get(type(copy))]
pub(crate) total_assignments: usize,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) depth_splits: Vec<f32>,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) cluster_aabbs_view: Vec<AxisAlignedBox3D>,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) light_refs: Vec<ClusteredLightRef>,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) cluster_counts: Vec<u32>,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) cluster_indices: Vec<u32>,
}