Skip to main content

euv_core/game/engine3d/environment/
struct.rs

1use super::*;
2
3/// Precomputed Image-Based Lighting (IBL) bundle combining L2 9-band SH diffuse irradiance, octahedral GGX specular mips, and Kulla-Conty BRDF LUT.
4#[derive(Clone, Data, Debug, PartialEq)]
5pub struct EnvironmentIbl3D {
6    /// Nine L2 Spherical Harmonics diffuse irradiance RGB coefficients (pre-convolved with cosine lobe).
7    #[get(type(copy))]
8    pub(crate) sh_irradiance: [[f32; 3]; 9],
9    /// Base `mip 0` edge resolution of the octahedral prefiltered specular environment map.
10    #[get(type(copy))]
11    pub(crate) specular_oct_size: u32,
12    /// Ordered roughness mip chain of octahedral prefiltered HDR RGB radiance maps.
13    pub(crate) specular_mips: Vec<Vec<[f32; 3]>>,
14    /// Edge resolution of the square Split-Sum GGX BRDF integration LUT (`NdotV` x `roughness`).
15    #[get(type(copy))]
16    pub(crate) brdf_lut_size: u32,
17    /// Flattened Split-Sum BRDF LUT storing `[scale, bias]` (`len == brdf_lut_size^2`).
18    pub(crate) brdf_lut: Vec<[f32; 2]>,
19    /// Global environment intensity multiplier.
20    #[get(type(copy))]
21    pub(crate) intensity: f32,
22    /// Optional Y-axis environment rotation in radians.
23    #[get(type(copy))]
24    pub(crate) rotation_y_rad: f32,
25}