27 m_illuminance_texture = std::make_shared<gl::texture_1d>
29 std::make_shared<gl::image_view_1d>
31 std::make_shared<gl::image_1d>
37 std::make_shared<gl::sampler>
51 m_illuminance_texture->get_image_view(),
55 m_illuminance_framebuffer = std::make_shared<gl::framebuffer>(attachments, 12, 1);
58 m_illuminance_matrices[0] = {};
59 m_illuminance_matrices[1] = {};
60 m_illuminance_matrices[2] = {};
65 m_illuminance_texture->get_image_view()->get_image()->read
75 std::as_writable_bytes(std::span{m_illuminance_matrices})
81 if (m_luminance_texture != texture)
83 m_luminance_texture = texture;
86 if (m_luminance_texture)
88 const auto face_size = texture->get_image_view()->get_image()->get_dimensions()[0];
89 const auto mip_count =
static_cast<std::uint32_t
>(std::bit_width(face_size));
91 m_luminance_framebuffers.resize(mip_count);
93 for (std::uint32_t i = 0; i < mip_count; ++i)
99 m_luminance_texture->get_image_view(),
103 m_luminance_framebuffers[i] = std::make_shared<gl::framebuffer>(attachments, face_size >> i, face_size >> i);
108 m_luminance_framebuffers.clear();
118 m_luminance_outdated = outdated;
123 m_illuminance_outdated = outdated;
126 void light_probe::transformed()
void set_luminance_texture(std::shared_ptr< gl::texture_cube > texture)
Sets the light probe's luminance texture.
void update_illuminance_matrices()
Updates the light probe's illuminance matrices from its illuminance texture.
void set_illuminance_outdated(bool outdated)
Marks the light probe's illuminance as either outdated or current.
light_probe()
Constructs a light probe.
void set_luminance_outdated(bool outdated)
Marks the light probe's luminance as either outdated or current.
constexpr const vector_type & get_translation() const noexcept
Returns the translation of the object.
@ clamp_to_edge
Clamp to edge wrap mode.
@ color_attachment_bit
Framebuffer color attachment.
@ nearest
Nearest filtering.
@ nearest
Nearest filtering.