euv-core 0.57.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::*;

/// Result of volumetric raymarching or froxel lookup containing accumulated in-scattered radiance and Beer-Lambert transmittance.
#[derive(Clone, Copy, Data, Debug, Default, New, PartialEq)]
pub struct VolumetricScatterResult3D {
    /// Accumulated linear HDR volumetric in-scattered RGB radiance along the ray.
    #[get(type(copy))]
    pub(crate) in_scattered_radiance: Vec3,
    /// Remaining view-ray Beer-Lambert transmittance strictly in `[0.0, 1.0]`.
    #[get(type(copy))]
    pub(crate) transmittance: f32,
}

/// Exponential height fog and raymarched crepuscular god-ray volumetric engine with pre-allocated 3D froxel slices.
#[derive(Clone, Data, Debug, PartialEq)]
pub struct VolumetricFogVolume3D {
    /// Sea-level / base-height fog extinction density in inverse meters.
    #[get(type(copy))]
    pub(crate) base_density: f32,
    /// Exponential vertical height falloff rate in inverse meters (`density = base * exp(-falloff * max(0, y - base_height))`).
    #[get(type(copy))]
    pub(crate) height_falloff: f32,
    /// Reference ground elevation in meters where fog density reaches `base_density`.
    #[get(type(copy))]
    pub(crate) base_height: f32,
    /// Single-scattering RGB albedo of suspended fog aerosols in `[0.0, 1.0]`.
    #[get(type(copy))]
    pub(crate) scattering_albedo: Vec3,
    /// Global extinction scale multiplier.
    #[get(type(copy))]
    pub(crate) extinction_scale: f32,
    /// Henyey-Greenstein Mie forward-scattering asymmetry `g` in `[-0.95, 0.95]`.
    #[get(type(copy))]
    pub(crate) anisotropy_g: f32,
    /// Beer-Powder multiple-scattering edge-brightening blend in `[0.0, 1.0]`.
    #[get(type(copy))]
    pub(crate) powder_strength: f32,
    /// Isotropic ambient sky in-scattering radiance inside shadowed fog regions.
    #[get(type(copy))]
    pub(crate) ambient_inscatter: Vec3,
    /// Maximum volumetric raymarching distance in meters.
    #[get(type(copy))]
    pub(crate) max_distance: f32,
    /// Number of raymarch integration steps along a view ray.
    #[get(type(copy))]
    pub(crate) raymarch_steps: usize,
    /// Horizontal froxel grid dimension.
    #[get(type(copy))]
    pub(crate) froxel_nx: usize,
    /// Vertical froxel grid dimension.
    #[get(type(copy))]
    pub(crate) froxel_ny: usize,
    /// Exponential depth froxel slice count.
    #[get(type(copy))]
    pub(crate) froxel_nz: usize,
    /// Cached froxel frustum near plane in meters.
    #[get(type(copy))]
    pub(crate) froxel_near: f32,
    /// Cached froxel frustum far plane in meters.
    #[get(type(copy))]
    pub(crate) froxel_far: f32,
    /// Pre-allocated frosted volumetric froxel volume storing `[inscatter_r, inscatter_g, inscatter_b, transmittance]`.
    #[get(pub(crate))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) froxel_buffer: Vec<[f32; 4]>,
}