pub struct ReflectionProbe {
pub position: Vec3,
pub box_half_extents: Vec3,
pub cubemap_faces: [Vec<Color>; 6],
pub resolution: u32,
pub mip_levels: u32,
pub valid: bool,
pub blend_distance: f32,
pub priority: u32,
}Expand description
A reflection probe that captures a cubemap for specular reflections. Supports parallax correction for box-shaped influence volumes.
Fields§
§position: Vec3§box_half_extents: Vec3Influence volume half-extents (box shape).
cubemap_faces: [Vec<Color>; 6]Cubemap data per face: 6 faces, each storing a flat array of Color values.
resolution: u32Resolution of each cubemap face.
mip_levels: u32Number of mip levels for roughness-based filtering.
valid: boolWhether this probe is valid (has been baked).
blend_distance: f32Blend distance from the edge of the box volume.
priority: u32Priority (higher = preferred when overlapping).
Implementations§
Source§impl ReflectionProbe
impl ReflectionProbe
pub fn new(position: Vec3, box_half_extents: Vec3, resolution: u32) -> Self
Sourcepub fn blend_weight(&self, point: Vec3) -> f32
pub fn blend_weight(&self, point: Vec3) -> f32
Compute the blend weight for a point (1.0 at center, 0.0 at edge + blend_distance).
Sourcepub fn parallax_correct(&self, point: Vec3, reflection_dir: Vec3) -> Vec3
pub fn parallax_correct(&self, point: Vec3, reflection_dir: Vec3) -> Vec3
Apply parallax correction to a reflection direction for box-projected cubemaps.
Sourcepub fn sample_cubemap(&self, direction: Vec3, _mip_level: u32) -> Color
pub fn sample_cubemap(&self, direction: Vec3, _mip_level: u32) -> Color
Sample the cubemap at a given direction and mip level.
Sourcepub fn fill_solid(&mut self, color: Color)
pub fn fill_solid(&mut self, color: Color)
Fill all faces with a solid color (for testing).
Trait Implementations§
Source§impl Clone for ReflectionProbe
impl Clone for ReflectionProbe
Source§fn clone(&self) -> ReflectionProbe
fn clone(&self) -> ReflectionProbe
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ReflectionProbe
impl RefUnwindSafe for ReflectionProbe
impl Send for ReflectionProbe
impl Sync for ReflectionProbe
impl Unpin for ReflectionProbe
impl UnsafeUnpin for ReflectionProbe
impl UnwindSafe for ReflectionProbe
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.