pub struct SsrSettings {
pub intensity: f32,
pub max_distance: f32,
}Expand description
Clamped SSR tunables resolved from the authored asset fields. Held by the
backend and turned into a per-frame SsrParams once the camera is known.
Fields§
§intensity: f32Reflection blend strength multiplier in [0, 1].
max_distance: f32World-space distance the reflection ray marches before giving up.
Implementations§
Source§impl SsrSettings
impl SsrSettings
Sourcepub fn resolve(intensity: f32, max_distance: f32) -> SsrSettings
pub fn resolve(intensity: f32, max_distance: f32) -> SsrSettings
Clamp the authored intensity / distance into a safe range.
Sourcepub fn params(
&self,
fov_y_radians: f32,
aspect: f32,
inv_view_rot: [[f32; 4]; 4],
cam_pos: [f32; 3],
prefilter_mip_count: f32,
) -> SsrParams
pub fn params( &self, fov_y_radians: f32, aspect: f32, inv_view_rot: [[f32; 4]; 4], cam_pos: [f32; 3], prefilter_mip_count: f32, ) -> SsrParams
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 resolve pass needs to project a view-space ray point to a UV.
inv_view_rot is the view-space to world-space rotation and cam_pos the
world camera position (together the rigid camera-to-world transform), and
prefilter_mip_count the IBL prefilter cubemap mip count (0 = no IBL); the
resolve uses these to sample the cubemap (or a reflection probe) as a
reflection fallback.
Trait Implementations§
Source§impl Clone for SsrSettings
impl Clone for SsrSettings
Source§fn clone(&self) -> SsrSettings
fn clone(&self) -> SsrSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more