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-scattering physical Rayleigh + Mie + Ozone atmospheric sky model with solar disc, aerial perspective, and night starfield.
#[derive(Clone, Copy, Data, Debug, PartialEq)]
pub struct PhysicalSky3D {
    /// Planetary radius in meters.
    #[get(type(copy))]
    pub(crate) planet_radius_m: f32,
    /// Outer atmospheric boundary radius in meters.
    #[get(type(copy))]
    pub(crate) atmosphere_radius_m: f32,
    /// Observer altitude above sea level in meters.
    #[get(type(copy))]
    pub(crate) observer_altitude_m: f32,
    /// Exponential Rayleigh scattering scale height in meters.
    #[get(type(copy))]
    pub(crate) rayleigh_scale_height_m: f32,
    /// Exponential Mie aerosol scale height in meters.
    #[get(type(copy))]
    pub(crate) mie_scale_height_m: f32,
    /// Cornette-Shanks / Henyey-Greenstein Mie asymmetry factor `g` in `[-0.95, 0.95]`.
    #[get(type(copy))]
    pub(crate) mie_anisotropy_g: f32,
    /// Ozone absorption strength multiplier (`1.0` = standard Earth stratosphere).
    #[get(type(copy))]
    pub(crate) ozone_strength: f32,
    /// Top-of-atmosphere solar irradiance scale.
    #[get(type(copy))]
    pub(crate) solar_irradiance: f32,
    /// Solar disc angular radius in radians.
    #[get(type(copy))]
    pub(crate) sun_angular_radius_rad: f32,
    /// Ground reflectance albedo for below-horizon hemisphere bounce.
    #[get(type(copy))]
    pub(crate) ground_albedo: Vec3,
    /// Procedural night starfield intensity multiplier.
    #[get(type(copy))]
    pub(crate) starfield_intensity: f32,
    /// Primary view-ray marching sample count (`4..=32`).
    #[get(type(copy))]
    pub(crate) primary_steps: usize,
    /// Secondary sun-transmittance optical-depth step count (`2..=12`).
    #[get(type(copy))]
    pub(crate) light_steps: usize,
}

/// Continuous solar ephemeris and atmospheric day/night controller with automatic `EnvironmentIbl3D` rebuild tracking.
#[derive(Clone, Copy, Data, Debug, PartialEq)]
pub struct DayNightCycle3D {
    /// Continuous local solar time in `[0.0, 24.0)` hours (`12.0` = solar noon).
    #[get(type(copy))]
    pub(crate) time_of_day_hours: f32,
    /// Observer geographic latitude in degrees (`-89.0..=89.0`).
    #[get(type(copy))]
    pub(crate) latitude_deg: f32,
    /// Day of year (`1.0..=365.0`, `81.0` = vernal equinox, `172.0` = summer solstice).
    #[get(type(copy))]
    pub(crate) day_of_year: f32,
    /// Simulated hours elapsed per real-time second in `advance`.
    #[get(type(copy))]
    pub(crate) time_scale_hours_per_sec: f32,
    /// Minimum sun angular shift in radians that flags `ibl_dirty = true`.
    #[get(type(copy))]
    pub(crate) ibl_rebuild_threshold_rad: f32,
    /// Sun direction captured during the latest `EnvironmentIbl3D` rebuild.
    #[get(type(copy))]
    pub(crate) last_ibl_sun_dir: Vec3,
    /// Whether the cached `EnvironmentIbl3D` should be rebaked due to solar movement.
    #[get(type(copy))]
    pub(crate) ibl_dirty: bool,
    /// Monotonically increasing counter incremented on every automatic IBL rebuild.
    #[get(type(copy))]
    pub(crate) ibl_generation: u64,
    /// Underlying physical Rayleigh + Mie + Ozone sky model.
    #[get(type(copy))]
    pub(crate) sky: PhysicalSky3D,
}