|
Unravel Engine C++ Reference
|
Class that contains core reflection probe data, used for rendering and other purposes. More...
#include <reflection_probe_component.h>
Public Member Functions | |
| auto | get_probe () const -> const reflection_probe & |
| Gets the reflection probe object. | |
| void | set_probe (const reflection_probe &probe) |
| Sets the reflection probe object. | |
| auto | get_bounds () const -> math::bbox |
| Gets the bounding box of the probe object. | |
| auto | compute_projected_sphere_rect (irect32_t &rect, const math::vec3 &position, const math::vec3 &scale, const math::vec3 &view_origin, const math::transform &view, const math::transform &proj) const -> int |
| Computes the projected sphere rectangle. | |
| auto | get_render_view (size_t idx) -> gfx::render_view & |
| Gets the render view. | |
| auto | get_cubemap_prefiltered () -> const gfx::texture::ptr & |
| Gets the cubemap texture. | |
| auto | get_cubemap () -> const gfx::texture::ptr & |
| auto | get_cubemap_fbo (size_t face) -> const gfx::frame_buffer::ptr & |
| Gets the cubemap frame buffer object (FBO). | |
| void | update (float dt) |
| Advances the probe's update bookkeeping. Called once per frame by reflection_probe_system. | |
| void | release_resources () |
| auto | already_generated () const -> bool |
| Check if the cubemap was generated this frame. | |
| auto | already_generated (size_t face) const -> bool |
| Check if the cubemap's face was generated this frame. | |
| void | set_generation_frame (size_t face, uint64_t frame) |
| marks the genrerated face this frame | |
| void | mark_dirty (bool force_full_first_frame=false) |
| Requests the probe to rebuild its cubemap. | |
| auto | is_dirty () const -> bool |
| Returns true if the probe has pending or in-flight cubemap generation work. | |
| auto | is_bake_cycle_unstarted () const -> bool |
| Returns true when a bake has been requested but no cubemap face has been emitted yet. | |
| auto | is_bake_complete () const -> bool |
| Returns true when all six cubemap faces have been rendered in the current bake cycle. | |
| auto | get_faces_per_frame () const -> size_t |
| Gets the number of faces generated per frame. | |
| void | set_faces_per_frame (size_t faces) |
| Sets the number of faces generated per frame. | |
| auto | get_apply_prefilter () const -> bool |
| Gets whether prefiltering is applied. | |
| void | set_apply_prefilter (bool apply) |
| Sets whether to apply prefiltering. | |
| auto | get_update_mode () const -> probe_update_mode |
| Gets the probe's update policy. | |
| void | set_update_mode (probe_update_mode mode) |
| Sets the probe's update policy. Switching INTO on_demand leaves the current bake state as-is; switching OUT of on_demand schedules a rebuild so the probe reflects its new behavior immediately. | |
| auto | get_update_interval () const -> float |
| Gets the realtime refresh interval in seconds. Only consulted for realtime probes. | |
| void | set_update_interval (float seconds) |
| Sets the realtime refresh interval in seconds. | |
| auto | get_resolution () const -> probe_resolution |
| Gets the cubemap face resolution. | |
| void | set_resolution (probe_resolution resolution) |
| Sets the cubemap face resolution. Triggers a rebuild when changed. | |
| auto | get_capture_sky () const -> bool |
| Returns true when the atmospheric sky pass is included during cubemap capture. | |
| void | set_capture_sky (bool capture) |
| Sets whether the atmospheric sky pass runs during cubemap capture. Disable for interior/local probes that should only reflect nearby geometry. | |
| auto | get_capture_shadows () const -> bool |
| Returns true when shadow maps are rendered during cubemap capture. | |
| void | set_capture_shadows (bool capture) |
| Sets whether shadow maps are built and sampled during cubemap capture. | |
Public Member Functions inherited from unravel::basic_component | |
| void | touch () |
| Marks the component as 'touched'. | |
Additional Inherited Members | |
Public Types inherited from unravel::component_crtp< reflection_probe_component > | |
| using | base |
Public Attributes inherited from unravel::basic_component | |
| bool | eto {} |
| Disable empty type optimizations. | |
Static Public Attributes inherited from unravel::component_crtp< reflection_probe_component > | |
| static constexpr bool | in_place_delete |
| Indicates if the component can be deleted in place. | |
Class that contains core reflection probe data, used for rendering and other purposes.
Definition at line 18 of file reflection_probe_component.h.
| auto unravel::reflection_probe_component::already_generated | ( | ) | const -> bool |
Check if the cubemap was generated this frame.
Definition at line 237 of file reflection_probe_component.cpp.
| auto unravel::reflection_probe_component::already_generated | ( | size_t | face | ) | const -> bool |
Check if the cubemap's face was generated this frame.
Definition at line 254 of file reflection_probe_component.cpp.
| auto unravel::reflection_probe_component::compute_projected_sphere_rect | ( | irect32_t & | rect, |
| const math::vec3 & | position, | ||
| const math::vec3 & | scale, | ||
| const math::vec3 & | view_origin, | ||
| const math::transform & | view, | ||
| const math::transform & | proj ) const -> int |
Computes the projected sphere rectangle.
| [out] | rect | Reference to the rectangle to be computed. |
| [in] | position | The position of the reflection probe. |
| [in] | view_origin | The origin of the view. |
| [in] | view | The view transform. |
| [in] | proj | The projection transform. |
Definition at line 27 of file reflection_probe_component.cpp.
|
inline |
Gets whether prefiltering is applied.
Definition at line 139 of file reflection_probe_component.h.
| auto unravel::reflection_probe_component::get_bounds | ( | ) | const -> math::bbox |
Gets the bounding box of the probe object.
Definition at line 7 of file reflection_probe_component.cpp.
|
inline |
Returns true when shadow maps are rendered during cubemap capture.
Definition at line 194 of file reflection_probe_component.h.
|
inline |
Returns true when the atmospheric sky pass is included during cubemap capture.
Definition at line 183 of file reflection_probe_component.h.
| auto unravel::reflection_probe_component::get_cubemap | ( | ) | -> const gfx::texture::ptr& |
Definition at line 75 of file reflection_probe_component.cpp.
| auto unravel::reflection_probe_component::get_cubemap_fbo | ( | size_t | face | ) | -> const gfx::frame_buffer::ptr& |
Gets the cubemap frame buffer object (FBO).
Definition at line 111 of file reflection_probe_component.cpp.
| auto unravel::reflection_probe_component::get_cubemap_prefiltered | ( | ) | -> const gfx::texture::ptr& |
Gets the cubemap texture.
Definition at line 93 of file reflection_probe_component.cpp.
|
inline |
Gets the number of faces generated per frame.
Definition at line 127 of file reflection_probe_component.h.
| auto unravel::reflection_probe_component::get_probe | ( | ) | const -> const reflection_probe& |
Gets the reflection probe object.
Definition at line 190 of file reflection_probe_component.cpp.
| auto unravel::reflection_probe_component::get_render_view | ( | size_t | idx | ) | -> gfx::render_view& |
Gets the render view.
| [in] | idx | The index of the render view to get. |
Definition at line 70 of file reflection_probe_component.cpp.
|
inline |
Gets the cubemap face resolution.
Definition at line 173 of file reflection_probe_component.h.
|
inline |
Gets the realtime refresh interval in seconds. Only consulted for realtime probes.
Definition at line 162 of file reflection_probe_component.h.
|
inline |
Gets the probe's update policy.
Definition at line 150 of file reflection_probe_component.h.
| auto unravel::reflection_probe_component::is_bake_complete | ( | ) | const -> bool |
Returns true when all six cubemap faces have been rendered in the current bake cycle.
Definition at line 321 of file reflection_probe_component.cpp.
| auto unravel::reflection_probe_component::is_bake_cycle_unstarted | ( | ) | const -> bool |
Returns true when a bake has been requested but no cubemap face has been emitted yet.
Definition at line 303 of file reflection_probe_component.cpp.
| auto unravel::reflection_probe_component::is_dirty | ( | ) | const -> bool |
Returns true if the probe has pending or in-flight cubemap generation work.
Definition at line 298 of file reflection_probe_component.cpp.
| void unravel::reflection_probe_component::mark_dirty | ( | bool | force_full_first_frame = false | ) |
Requests the probe to rebuild its cubemap.
The next reflection-generation pass will begin emitting new faces. When force_full_first_frame is true, all six faces are baked in a single frame (matching the first-ever-generation behavior) instead of being time-sliced by faces_per_frame. Use this for manual "Bake now" actions where the user wants an instant result.
Definition at line 279 of file reflection_probe_component.cpp.
| void unravel::reflection_probe_component::release_resources | ( | ) |
Definition at line 184 of file reflection_probe_component.cpp.
|
inline |
Sets whether to apply prefiltering.
| apply | True to apply prefiltering, false otherwise. |
Definition at line 145 of file reflection_probe_component.h.
| void unravel::reflection_probe_component::set_capture_shadows | ( | bool | capture | ) |
Sets whether shadow maps are built and sampled during cubemap capture.
Definition at line 372 of file reflection_probe_component.cpp.
| void unravel::reflection_probe_component::set_capture_sky | ( | bool | capture | ) |
Sets whether the atmospheric sky pass runs during cubemap capture. Disable for interior/local probes that should only reflect nearby geometry.
Definition at line 356 of file reflection_probe_component.cpp.
|
inline |
Sets the number of faces generated per frame.
| faces | The number of faces to generate per frame (1-6). Only used while a bake is in progress. |
Definition at line 133 of file reflection_probe_component.h.
| void unravel::reflection_probe_component::set_generation_frame | ( | size_t | face, |
| uint64_t | frame ) |
marks the genrerated face this frame
Definition at line 273 of file reflection_probe_component.cpp.
| void unravel::reflection_probe_component::set_probe | ( | const reflection_probe & | probe | ) |
Sets the reflection probe object.
| [in] | probe | The reflection probe object to set. |
Definition at line 195 of file reflection_probe_component.cpp.
| void unravel::reflection_probe_component::set_resolution | ( | probe_resolution | resolution | ) |
Sets the cubemap face resolution. Triggers a rebuild when changed.
Definition at line 339 of file reflection_probe_component.cpp.
|
inline |
Sets the realtime refresh interval in seconds.
| seconds | 0 means "every available frame" (still time-sliced by faces_per_frame). |
Definition at line 168 of file reflection_probe_component.h.
| void unravel::reflection_probe_component::set_update_mode | ( | probe_update_mode | mode | ) |
Sets the probe's update policy. Switching INTO on_demand leaves the current bake state as-is; switching OUT of on_demand schedules a rebuild so the probe reflects its new behavior immediately.
Definition at line 215 of file reflection_probe_component.cpp.
| void unravel::reflection_probe_component::update | ( | float | dt | ) |
Advances the probe's update bookkeeping. Called once per frame by reflection_probe_system.
| [in] | dt | Frame delta time in seconds. Used to drive the realtime update interval. |
Definition at line 142 of file reflection_probe_component.cpp.