euv-core 0.52.1

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
/// Thread name prefix for persistent 3D parallel rendering workers.
#[cfg(not(target_arch = "wasm32"))]
pub(crate) const ENGINE3D_WORKER_PREFIX: &str = "euv-3d";

/// Maximum total 3D renderer threads (caller plus background workers) in `Engine3dWorkerPool`.
#[cfg(not(target_arch = "wasm32"))]
pub(crate) const ENGINE3D_WORKER_MAX_THREADS: usize = 24;

/// Extended spin-loop iterations performed by idle 3D workers before parking, eliminating mid-frame futex wakeups.
#[cfg(not(target_arch = "wasm32"))]
pub(crate) const ENGINE3D_WORKER_SPIN_LIMIT: u32 = 3072;

/// Extended spin-loop iterations performed by the calling thread before parking on `wake_caller`.
#[cfg(not(target_arch = "wasm32"))]
pub(crate) const ENGINE3D_CALLER_SPIN_LIMIT: u32 = 2048;

/// Maximum coarse probe grid width (`gw`) handled in L1-stack single-row streaming denoising (`<= 2048px` wide viewports at `rt_step = 4`).
pub(crate) const PROBE_ROW_STACK_CAP: usize = 512;

/// Maximum pixel dimension for L1-resident stack tile rasterization buffers (`64x64`).
pub(crate) const ENGINE3D_TILE_MAX_PX: usize = 64;

/// Maximum tangent edge-walk radius in pixels for morphological silhouette anti-aliasing.
pub(crate) const MLAA_MAX_WALK_STEPS: usize = 8;

/// 16-tap Vogel-disk blue-noise tangent offsets for frame-rotated soft-shadow ray penumbras.
pub(crate) const SOFT_SHADOW_RING_16: [(f32, f32); 16] = [
    (0.005, 0.004),
    (-0.009, 0.007),
    (0.004, -0.013),
    (0.014, 0.006),
    (-0.015, -0.009),
    (-0.002, 0.018),
    (0.017, -0.011),
    (-0.020, 0.005),
    (0.009, 0.019),
    (0.011, -0.019),
    (-0.019, -0.013),
    (-0.008, 0.021),
    (0.022, 0.002),
    (-0.014, -0.018),
    (-0.003, -0.022),
    (0.016, 0.016),
];

/// 16-direction Fibonacci hemisphere blue-noise jitter vectors rotated across frames for silky Lumen GI convergence.
pub(crate) const GI_HEMI_RING_16: [[f32; 3]; 16] = [
    [0.38, 0.52, -0.24],
    [-0.34, 0.56, 0.28],
    [0.24, 0.48, 0.36],
    [-0.28, 0.50, -0.34],
    [0.44, 0.42, 0.16],
    [-0.42, 0.44, -0.18],
    [0.14, 0.60, -0.40],
    [-0.16, 0.58, 0.42],
    [0.36, 0.46, 0.30],
    [-0.38, 0.48, -0.28],
    [0.26, 0.54, -0.32],
    [-0.22, 0.52, 0.38],
    [0.46, 0.38, -0.14],
    [-0.44, 0.40, 0.16],
    [0.18, 0.56, 0.38],
    [-0.18, 0.58, -0.36],
];

/// Minimum frustum-visible object count activating the 8-way parallel geometry front-end.
pub(crate) const GEOM_PARALLEL_MIN_OBJECTS: usize = 48;

/// Fixed worker chunk count for deterministic parallel geometry projection and triangle setup.
pub(crate) const GEOM_PARALLEL_CHUNKS: usize = 8;

/// Target mid-gray normalized luminance for UE5-style eye-adaptation auto-exposure.
pub(crate) const AUTO_EXPOSURE_TARGET_LUMA: f32 = 0.38;

/// Lower clamp bound for smooth eye-adaptation exposure multiplier.
pub(crate) const AUTO_EXPOSURE_MIN: f32 = 0.80;

/// Upper clamp bound for smooth eye-adaptation exposure multiplier.
pub(crate) const AUTO_EXPOSURE_MAX: f32 = 1.38;

/// Per-frame eye-adaptation smoothing blend weight.
pub(crate) const AUTO_EXPOSURE_ADAPT_RATE: f32 = 0.08;

/// 8-tap Halton(2, 3) subpixel jitter pattern centered in `[-0.35, +0.35]` pixels for temporal super-sampling (TAA).
pub(crate) const HALTON_JITTER_8: [(f32, f32); 8] = [
    (0.0, 0.0),
    (-0.25, 0.166_667),
    (0.25, -0.166_667),
    (-0.125, -0.333_333),
    (0.125, 0.333_333),
    (-0.312_5, -0.055_556),
    (0.312_5, 0.055_556),
    (-0.062_5, 0.277_778),
];

/// Pre-baked hemi-octahedral 3D atmospheric sky dome LUT width in texels.
pub(crate) const SKY3D_LUT_W: usize = 160;

/// Pre-baked hemi-octahedral 3D atmospheric sky dome LUT height in texels.
pub(crate) const SKY3D_LUT_H: usize = 160;

/// Number of entries in the 3D L1-resident ACES filmic + sRGB gamma LUT (`0..=1024`).
pub(crate) const ACES3D_LUT_SIZE: usize = 1025;

/// Rational knee constant mapping linear HDR radiance onto `[0, 1]` for the 3D ACES+sRGB LUT.
pub(crate) const ACES3D_LUT_KNEE: f32 = 0.42;

/// 5-octave directional ocean wave spectrum `[dir_x, dir_z, freq, amp, speed]` for the coastal island water boundary.
pub(crate) const OCEAN3D_WAVE_SPECTRUM: [[f32; 5]; 5] = [
    [0.84, 0.54, 0.24, 0.22, 1.35],
    [-0.58, 0.81, 0.42, 0.14, 1.85],
    [0.32, -0.95, 0.78, 0.085, 2.45],
    [-0.89, -0.45, 1.38, 0.048, 3.10],
    [0.65, -0.76, 2.35, 0.026, 3.85],
];