euv-core 0.56.0

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
use super::*;

/// Single roughness-prefiltered 6-face cubemap mip level stored inside `ReflectionProbe3D`.
#[derive(Clone, Data, Debug, PartialEq)]
pub struct CubeMapMip3D {
    /// Edge resolution of each square cubemap face in texels.
    #[get(type(copy))]
    pub(crate) face_size: u32,
    /// Perceptual roughness in `[0.0, 1.0]` represented by this mip level.
    #[get(type(copy))]
    pub(crate) roughness: f32,
    /// Flattened 6-face linear HDR RGB texels (`len == 6 * face_size * face_size`).
    pub(crate) texels: Vec<[f32; 3]>,
}

/// Box-parallax-corrected local specular cubemap reflection probe with roughness mip chain and smooth falloff.
#[derive(Clone, Data, Debug, PartialEq)]
pub struct ReflectionProbe3D {
    /// World-space capture origin of the cubemap probe.
    #[get(type(copy))]
    pub(crate) position: Vec3,
    /// Local world-space box volume driving both influence blending and parallax correction.
    #[get(type(copy))]
    pub(crate) bounds: AxisAlignedBox3D,
    /// Smooth falloff blend margin inside the outer boundary in meters.
    #[get(type(copy))]
    pub(crate) blend_distance: f32,
    /// Global specular probe intensity multiplier.
    #[get(type(copy))]
    pub(crate) intensity: f32,
    /// Base `mip 0` cubemap face edge resolution in texels.
    #[get(type(copy))]
    pub(crate) base_face_size: u32,
    /// Ordered roughness mip levels from sharp mirror (`[0]`) to rough matte (`[len - 1]`).
    pub(crate) mip_levels: Vec<CubeMapMip3D>,
}

/// Nine-band L2 Spherical Harmonics diffuse irradiance probe (`9` RGB coefficients pre-convolved with cosine lobe).
#[derive(Clone, Copy, Data, Debug, Default, New, PartialEq)]
pub struct Sh9Probe3D {
    /// Nine RGB L2 Spherical Harmonics irradiance coefficients `[Y00 .. Y22]`.
    #[get(type(copy))]
    pub(crate) coefficients: [[f32; 3]; SH9_BAND_COUNT],
}

/// Regular 3D grid of L2 Spherical Harmonics irradiance probes supporting trilinear interpolation, normal bias, and automated baking.
#[derive(Clone, Data, Debug, PartialEq)]
pub struct LightProbeGrid3D {
    /// World-space axis-aligned volume spanned by the regular probe lattice.
    #[get(type(copy))]
    pub(crate) bounds: AxisAlignedBox3D,
    /// Probe grid dimensions `[nx, ny, nz]` along `(X, Y, Z)` (each `>= 1`).
    #[get(type(copy))]
    pub(crate) dims: [usize; 3],
    /// World-space surface-normal offset applied during sampling to prevent thin-wall light leaking.
    #[get(type(copy))]
    pub(crate) normal_bias: f32,
    /// Contiguous row-major probe array (`len == nx * ny * nz`, index = `(iz * ny + iy) * nx + ix`).
    pub(crate) probes: Vec<Sh9Probe3D>,
}