nightshade-renderer 0.53.0

GPU-driven wgpu renderer with a built-in frame graph.
Documentation
//! Scene-wide wind state, owned by the render layer for the cloth simulation.

use nalgebra_glm::Vec3;

/// Global wind affecting every cloth in the scene, stored at
/// [`RenderInputs::wind`](crate::wgpu::render_configs::RenderInputs).
///
/// The cloth simulation samples this each frame: the steady component is
/// `direction * strength`, gusts add a sinusoidal surge of up to
/// `gust_strength` at `gust_frequency` cycles per second, and `turbulence`
/// adds spatially varying swirl. Each cloth scales the result by its own
/// `wind_response`.
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Wind {
    /// Direction the wind blows toward. Does not need to be normalized.
    pub direction: Vec3,
    /// Steady wind speed in m/s.
    pub strength: f32,
    /// Peak additional speed of gusts in m/s.
    pub gust_strength: f32,
    /// Gust cycles per second.
    pub gust_frequency: f32,
    /// Magnitude of spatially varying swirl in m/s.
    pub turbulence: f32,
}

impl Default for Wind {
    fn default() -> Self {
        Self {
            direction: Vec3::new(0.42, 0.0, 0.91),
            strength: 3.0,
            gust_strength: 2.0,
            gust_frequency: 0.5,
            turbulence: 1.5,
        }
    }
}