48 const math::vec3& position,
49 const math::vec3&
scale,
50 const math::vec3& view_origin,
130 std::array<gfx::render_view, 6> rview_;
132 std::array<uint64_t, 6> generated_frame_{uint64_t(-1),
139 bool apply_prefilter_{
false};
140 size_t faces_per_frame_ = 1;
141 size_t generated_faces_count_ = 0;
142 bool first_generation_{
true};
std::shared_ptr< texture > ptr
Class that contains core reflection probe data, used for rendering and other purposes.
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.
void set_apply_prefilter(bool apply)
Sets whether to apply prefiltering.
void set_faces_per_frame(size_t faces)
Sets the number of faces generated per frame.
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 get_apply_prefilter() const -> bool
Gets whether prefiltering is applied.
auto get_probe() const -> const reflection_probe &
Gets the reflection probe object.
void update()
Updates the reflection probe component.
auto get_cubemap_prefiltered() -> const gfx::texture::ptr &
Gets the cubemap texture.
void set_generation_frame(size_t face, uint64_t frame)
marks the genrerated face this frame
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.
Storage for box vector values and wraps up common functionality.
CRTP (Curiously Recurring Template Pattern) base structure for components.
Structure representing a reflection probe.