pub struct ReflectionProbe {
pub position: [f32; 3],
pub half_extents: [f32; 3],
}Expand description
A localized reflection probe. The renderer captures the surrounding scene
into a cubemap from position and uses it for the specular reflection on
glossy surfaces within the influence box (position plus or minus
half_extents). The box is also the parallax-correction volume, so a
reflection stays anchored to the surrounding geometry as the camera moves.
Place several across a level so reflections stay accurate as a first-person
camera moves between areas (a room, a courtyard, a corridor): each surface
uses the probe whose box it sits deepest inside, and cross-fades into the
neighbouring box near a shared boundary so reflections don’t pop as the camera
crosses between them. When a world declares no ReflectionProbe, the renderer
auto-seeds a small grid of probes from the scene bounds, so existing scenes
still get local reflections without authoring.
Reflections are most accurate near position; a tighter box around a
distinct space (a room) parallax-corrects better than one large box. Boxes may
overlap freely: a surface inside several boxes blends all of them, so reflections
cross-fade smoothly as the camera moves between probes.
ReflectionProbe {
position: [0.0, 1.7, 0.0],
half_extents: [8.0, 4.0, 8.0],
..Default::default()
};Fields§
§position: [f32; 3]World-space capture point the cubemap is rendered from. Put it at roughly eye height in open space (not inside geometry) for the area it serves.
half_extents: [f32; 3]Half-size of the influence box around position, per axis. A surface
inside position plus or minus half_extents may select this probe, and
the box is the parallax-correction volume. Make it span the local space
the probe represents (e.g. a room’s walls).
Trait Implementations§
Source§impl Authored for ReflectionProbe
impl Authored for ReflectionProbe
Source§impl Clone for ReflectionProbe
impl Clone for ReflectionProbe
Source§fn clone(&self) -> ReflectionProbe
fn clone(&self) -> ReflectionProbe
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Component for ReflectionProbe
impl Component for ReflectionProbe
Source§const NAME: &'static str = "ReflectionProbe"
const NAME: &'static str = "ReflectionProbe"
Source§fn from_baked(bytes: &[u8]) -> Result<ReflectionProbe, CnResult>
fn from_baked(bytes: &[u8]) -> Result<ReflectionProbe, CnResult>
Source§fn inject_locator(&mut self, _locator: PayloadLocator)
fn inject_locator(&mut self, _locator: PayloadLocator)
Source§fn inject_name(&mut self, _id: AssetId)
fn inject_name(&mut self, _id: AssetId)
Source§impl ComponentSlot for ReflectionProbe
impl ComponentSlot for ReflectionProbe
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.Source§fn slot(s: &ComponentStorage) -> &Column<ReflectionProbe>
fn slot(s: &ComponentStorage) -> &Column<ReflectionProbe>
Source§fn slot_mut(s: &mut ComponentStorage) -> &mut Column<ReflectionProbe>
fn slot_mut(s: &mut ComponentStorage) -> &mut Column<ReflectionProbe>
Source§impl Debug for ReflectionProbe
impl Debug for ReflectionProbe
Source§impl Default for ReflectionProbe
impl Default for ReflectionProbe
Source§fn default() -> ReflectionProbe
fn default() -> ReflectionProbe
Source§impl<'de> Deserialize<'de> for ReflectionProbewhere
ReflectionProbe: Default,
impl<'de> Deserialize<'de> for ReflectionProbewhere
ReflectionProbe: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ReflectionProbe, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ReflectionProbe, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl RuntimeComponent for ReflectionProbe
Source§impl Serialize for ReflectionProbe
impl Serialize for ReflectionProbe
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto 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§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more