pub struct SsgiSettings {
pub intensity: f32,
pub max_distance: f32,
pub rays: u32,
pub steps: u32,
pub gi_scale: u32,
}Expand description
Clamped SSGI tunables resolved from the authored asset fields. Held by the
backend and turned into a per-frame SsgiParams once the camera is known.
Fields§
§intensity: f32Indirect-bounce blend strength multiplier in [0, MAX_INTENSITY].
max_distance: f32World-space distance a hemisphere ray marches before giving up.
rays: u32Hemisphere rays cast per pixel, clamped to [MIN_RAYS, MAX_RAYS].
steps: u32Ray-march samples per ray, clamped to [MIN_STEPS, MAX_STEPS].
gi_scale: u32Render-resolution divisor for the gather target: 1 is full resolution, 2 is half (a quarter of the pixels), 4 a quarter. The composite pass is a depth-aware bilateral filter, so it upsamples the lower-resolution gather back to full resolution for free. Backends that always allocate the gather at full resolution treat this as 1.
Implementations§
Source§impl SsgiSettings
impl SsgiSettings
Sourcepub fn resolve(
intensity: f32,
max_distance: f32,
rays: u32,
steps: u32,
gi_scale: u32,
) -> SsgiSettings
pub fn resolve( intensity: f32, max_distance: f32, rays: u32, steps: u32, gi_scale: u32, ) -> SsgiSettings
Clamp the authored tunables into safe ranges.
Sourcepub fn gi_dimensions(&self, render_w: u32, render_h: u32) -> (u32, u32)
pub fn gi_dimensions(&self, render_w: u32, render_h: u32) -> (u32, u32)
Gather-target dimensions for a given render resolution: the render size
divided by gi_scale, never below 1x1.
Sourcepub fn params(&self, fov_y_radians: f32, aspect: f32) -> SsgiParams
pub fn params(&self, fov_y_radians: f32, aspect: f32) -> SsgiParams
Build the per-frame GPU uniform from these settings and the active
camera. fov_y_radians is the vertical field of view and aspect the
viewport width / height ratio: together they give the view-ray scale
the gather pass needs to project a view-space ray point to a UV.
Trait Implementations§
Source§impl Clone for SsgiSettings
impl Clone for SsgiSettings
Source§fn clone(&self) -> SsgiSettings
fn clone(&self) -> SsgiSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more