49 const math::vec3&
scale,
50 const math::vec3& view_origin,
106 void mark_dirty(
bool force_full_first_frame =
false);
210 std::array<gfx::render_view, 6> face_rviews_;
213 std::array<uint64_t, 6> generated_frame_{uint64_t(-1),
220 bool apply_prefilter_{
true};
223 size_t faces_per_frame_ = 1;
225 size_t generated_faces_count_ = 0;
228 bool first_generation_{
true};
230 float time_since_last_refresh_ = 0.0f;
234 bool has_pending_bake_{
false};
242 float update_interval_{0.0f};
246 bool capture_sky_{
true};
248 bool capture_shadows_{
true};
std::shared_ptr< texture > ptr
Class that contains core reflection probe data, used for rendering and other purposes.
auto is_dirty() const -> bool
Returns true if the probe has pending or in-flight cubemap generation work.
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_resolution() const -> probe_resolution
Gets the cubemap face resolution.
void set_apply_prefilter(bool apply)
Sets whether to apply prefiltering.
void mark_dirty(bool force_full_first_frame=false)
Requests the probe to rebuild its cubemap.
void set_capture_sky(bool capture)
Sets whether the atmospheric sky pass runs during cubemap capture. Disable for interior/local probes ...
void set_faces_per_frame(size_t faces)
Sets the number of faces generated per frame.
auto get_update_interval() const -> float
Gets the realtime refresh interval in seconds. Only consulted for realtime probes.
auto get_cubemap_fbo(size_t face) -> const gfx::frame_buffer::ptr &
Gets the cubemap frame buffer object (FBO).
auto get_bounds() const -> math::bbox
Gets the bounding box of the probe object.
auto is_bake_complete() const -> bool
Returns true when all six cubemap faces have been rendered in the current bake cycle.
void set_update_interval(float seconds)
Sets the realtime refresh interval in seconds.
auto get_apply_prefilter() const -> bool
Gets whether prefiltering is applied.
auto get_probe() const -> const reflection_probe &
Gets the reflection probe object.
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.
auto get_cubemap_prefiltered() -> const gfx::texture::ptr &
Gets the cubemap texture.
auto get_update_mode() const -> probe_update_mode
Gets the probe's update policy.
void set_capture_shadows(bool capture)
Sets whether shadow maps are built and sampled during cubemap capture.
void update(float dt)
Advances the probe's update bookkeeping. Called once per frame by reflection_probe_system.
auto is_bake_cycle_unstarted() const -> bool
Returns true when a bake has been requested but no cubemap face has been emitted yet.
void set_generation_frame(size_t face, uint64_t frame)
marks the genrerated face this frame
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; switchi...
auto get_capture_shadows() const -> bool
Returns true when shadow maps are rendered during cubemap capture.
auto get_render_view(size_t idx) -> gfx::render_view &
Gets the render view.
auto get_faces_per_frame() const -> size_t
Gets the number of faces generated per frame.
auto already_generated() const -> bool
Check if the cubemap was generated this frame.
auto get_cubemap() -> const gfx::texture::ptr &
void set_probe(const reflection_probe &probe)
Sets the reflection probe object.
probe_update_mode
Enum class describing when a reflection probe refreshes its cubemap.
@ once
Bakes once on load (or when edited in the editor), then stops refreshing until marked dirty.
probe_resolution
Fixed cubemap face resolutions supported by reflection probes.
std::vector< float > scale
Storage for box vector values and wraps up common functionality.
CRTP (Curiously Recurring Template Pattern) base structure for components.
Structure representing a reflection probe.