class ReflectionProbe

Specifies a location at which a pre-computed texture containing scene radiance will be generated.

This texture will then be used by the renderer to provide specular reflections.

Public

Constructors

ReflectionProbe

ReflectionProbe(const HSceneObject &parent)

Methods

SetType

void SetType(ReflectionProbeType type)

Determines the type of the probe.

SetRadius

void SetRadius(float radius)

Determines the radius of a sphere reflection probe.

SetExtents

void SetExtents(const Vector3 &extents)

Determines the extents of a box reflection probe.

Determines range of influence.

SetTransitionDistance

void SetTransitionDistance(float distance)

Determines a distance that will be used for fading out the box reflection probe with distance.

By default it is equal to one, and can never be less than one. Only relevant for box probes.

SetCustomTexture

void SetCustomTexture(const HTexture &texture)

Allows you assign a custom texture to use as a reflection map.

This will disable automatic generation of reflections. To re-enable auto-generation call this with a null parameter.

GetCustomTexture

HTexture GetCustomTexture() const

GetWorldRadius

float GetWorldRadius() const

Returns the radius of a sphere reflection probe, scaled by scene object transform.

GetWorldExtents

Vector3 GetWorldExtents() const

Returns the extents of a box reflection probe, scaled by scene object transform.

Capture

void Capture()

Captures the scene at the current location and generates a filtered reflection cubemap.

No action is taken if a custom texture is set.

staticGetRttiStatic

static RTTIType *GetRttiStatic()

GetRtti

RTTIType *GetRtti() const override

Returns an interface you can use to access class' Run Time Type Information.

GetType

ReflectionProbeType GetType() const

Determines the type of the probe.

GetRadius

float GetRadius() const

Returns the radius of a sphere reflection probe (unscaled).

GetExtents

const Vector3 &GetExtents() const

Returns the extents of a box reflection probe (unscaled).

GetBounds

Sphere GetBounds() const

Returns world space bounds that completely encompass the probe's area of influence.

GetTransitionDistance

float GetTransitionDistance() const

Determines a distance that will be used for fading out the box reflection probe with distance.

By default it is equal to one, and can never be less than one. Only relevant for box probes.

GetFilteredTexture

const SPtr<TextureType> &GetFilteredTexture() const

Returns a pre-filtered texture that is generated either from the provided custom texture, or from scene capture.

Protected

Constructors

ReflectionProbe

ReflectionProbe()

Methods

Initialize

void Initialize() override

Construct any resources the component needs before use.

Called when the parent scene object is initialized. A non-initialized component shouldn't be used in a live scene (i.e. it should not receive any of the component logic updates or events).

OnCreated

void OnCreated() override

Called once when the component has been created.

Called regardless of the state the component is in.

OnEnabled

void OnEnabled() override

Called every time a component leaves the Stopped state, if the component is enabled.

This includes component creation if requirements for leaving the Stopped state are met. When called during creation it is called after OnBeginPlay.

OnDisabled

void OnDisabled() override

Called every time a component is placed into the Stopped state.

This includes component destruction if component wasn't already in Stopped state during destruction. When called during destruction it is called before OnDestroyed.

OnDestroyed

void OnDestroyed() override

Called once just before the component is destroyed.

Called regardless of the state the component is in.

OnSceneChanged

void OnSceneChanged(SceneInstance *oldScene, ecs::Entity oldEntity) override

Called when the parent SceneObject's ECS entity is migrated to a new registry (e.g. when moving between scenes).

The old scene and entity are provided so that components can access sub-systems (renderer, physics, etc.) and read any data stored only in ECS fragments.

OnTransformChanged

void OnTransformChanged(TransformChangedFlags flags) override

Called when the component's parent scene object has changed.

Not called if the component is in Stopped state. Also only called if necessary notify flags are set via SetNotifyFlagsInternal().

Update

void Update() override

Called once per frame.

Only called if the component is in Running state.

Private

Methods

MarkRenderProxyDataDirty

void MarkRenderProxyDataDirty(ComponentDirtyFlag flag = ComponentDirtyFlag::Everything)

Marks the reflection probe as dirty, adding the appropriate ECS dirty tag.

GetReflectionProbeData

const TReflectionProbeData<false> &GetReflectionProbeData() const

Returns a reference to the reflection probe data for the CRTP getter interface.

GetFragment

ecs::ReflectionProbe &GetFragment()

Returns a mutable reference to the ECS reflection probe fragment.

GetFragment

const ecs::ReflectionProbe &GetFragment() const

Returns a const reference to the ECS reflection probe fragment.

UpdateBounds

void UpdateBounds()

Updates the internal bounds for the probe.

Call this whenever a property affecting the bounds changes.