Skip to main content

ReflectionProbe3D

Struct ReflectionProbe3D 

Source
pub struct ReflectionProbe3D { /* private fields */ }
Expand description

Box-parallax-corrected local specular cubemap reflection probe with roughness mip chain and smooth falloff.

Implementations§

Source§

impl ReflectionProbe3D

Baking, box-parallax correction, smooth blend-distance falloff, and trilinear roughness-mip sampling for ReflectionProbe3D.

Source

pub fn bake_from_sampler<F>( position: Vec3, bounds: AxisAlignedBox3D, blend_distance: f32, face_size: u32, mip_count: usize, sampler: F, ) -> Self
where F: Fn(Vec3) -> Vec3,

Bakes a 6-face GGX-prefiltered ReflectionProbe3D from any directional environment radiance closure.

§Arguments
  • Vec3 - Probe world-space capture center.
  • AxisAlignedBox3D - Local box volume for influence and parallax correction.
  • f32 - Smooth blend fade margin in meters (>= 0.01).
  • u32 - Base mip 0 cubemap face resolution (clamped >= 4).
  • usize - Number of roughness mip levels (clamped 1..=6).
  • F - Directional radiance callback mapping unit direction to linear HDR RGB.
§Returns
  • Self - Prefiltered local reflection probe.
Source

pub fn bake_from_sky_and_rig( position: Vec3, bounds: AxisAlignedBox3D, blend_distance: f32, resolution_mips: (u32, usize), sky: &PhysicalSky3D, sun_dir: Vec3, rig: &LightRig3D, ) -> Self

Bakes a local ReflectionProbe3D combining PhysicalSky3D and local highlights from LightRig3D.

§Arguments
  • Vec3 - Probe capture center.
  • AxisAlignedBox3D - Parallax and influence box bounds.
  • f32 - Smooth blend fade margin in meters.
  • (u32, usize) - (base_face_size, mip_count) cubemap pyramid settings.
  • &PhysicalSky3D - Atmospheric sky dome.
  • Vec3 - Unit sun direction.
  • &LightRig3D - Scene light rig contributing local specular highlights.
§Returns
  • Self - Prefiltered reflection probe.
Source

pub fn parallax_correct_direction( &self, world_pos: Vec3, reflect_dir: Vec3, ) -> Vec3

Applies Lagarde box-parallax correction to reflection vector reflect_dir originating at world_pos.

§Arguments
  • Vec3 - World-space shading point.
  • Vec3 - World-space reflection direction vector.
§Returns
  • Vec3 - Parallax-corrected unit cubemap lookup direction anchored at self.position.
Source

pub fn blend_weight(&self, world_pos: Vec3) -> f32

Evaluates the smooth Hermite box-influence blend weight in [0.0, 1.0] at world_pos.

§Arguments
  • Vec3 - World-space shading point.
§Returns
  • f32 - Smooth influence weight (1.0 inside inner core, 0.0 outside box bounds).
Source

pub fn sample_specular( &self, world_pos: Vec3, reflect_dir: Vec3, roughness: f32, ) -> (Vec3, f32)

Samples parallax-corrected trilinearly filtered specular radiance and influence weight (radiance, weight).

§Arguments
  • Vec3 - World-space shading position.
  • Vec3 - World-space reflection vector.
  • f32 - Surface perceptual roughness in [0.0, 1.0].
§Returns
  • (Vec3, f32) - (prefiltered_specular_rgb, blend_weight) tuple.
Source§

impl ReflectionProbe3D

Implements impl #impl_generics #name #ty_generics #where_clause.

Source

pub fn get_position(&self) -> Vec3

Source

pub fn get_mut_position(&mut self) -> &mut Vec3

Source

pub fn set_position(&mut self, val: Vec3) -> &mut Self

Source

pub fn get_bounds(&self) -> AxisAlignedBox3D

Source

pub fn get_mut_bounds(&mut self) -> &mut AxisAlignedBox3D

Source

pub fn set_bounds(&mut self, val: AxisAlignedBox3D) -> &mut Self

Source

pub fn get_blend_distance(&self) -> f32

Source

pub fn get_mut_blend_distance(&mut self) -> &mut f32

Source

pub fn set_blend_distance(&mut self, val: f32) -> &mut Self

Source

pub fn get_intensity(&self) -> f32

Source

pub fn get_mut_intensity(&mut self) -> &mut f32

Source

pub fn set_intensity(&mut self, val: f32) -> &mut Self

Source

pub fn get_base_face_size(&self) -> u32

Source

pub fn get_mut_base_face_size(&mut self) -> &mut u32

Source

pub fn set_base_face_size(&mut self, val: u32) -> &mut Self

Source

pub fn get_mip_levels(&self) -> &Vec<CubeMapMip3D>

Source

pub fn get_mut_mip_levels(&mut self) -> &mut Vec<CubeMapMip3D>

Source

pub fn set_mip_levels(&mut self, val: Vec<CubeMapMip3D>) -> &mut Self

Trait Implementations§

Source§

impl Clone for ReflectionProbe3D

Source§

fn clone(&self) -> Self

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 Debug for ReflectionProbe3D

Source§

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

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

impl PartialEq for ReflectionProbe3D

Source§

fn eq(&self, other: &Self) -> 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 ReflectionProbe3D

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, !>

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.