Skip to main content

SsgiSettings

Struct SsgiSettings 

Source
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: f32

Indirect-bounce blend strength multiplier in [0, MAX_INTENSITY].

§max_distance: f32

World-space distance a hemisphere ray marches before giving up.

§rays: u32

Hemisphere rays cast per pixel, clamped to [MIN_RAYS, MAX_RAYS].

§steps: u32

Ray-march samples per ray, clamped to [MIN_STEPS, MAX_STEPS].

§gi_scale: u32

Render-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

Source

pub fn resolve( intensity: f32, max_distance: f32, rays: u32, steps: u32, gi_scale: u32, ) -> SsgiSettings

Clamp the authored tunables into safe ranges.

Source

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.

Source

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

Source§

fn clone(&self) -> SsgiSettings

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SsgiSettings

Source§

impl Debug for SsgiSettings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SsgiSettings

Source§

fn eq(&self, other: &SsgiSettings) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SsgiSettings

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.