Antkeeper
0.0.1
|
#include <light-probe.hpp>
Public Member Functions | |
light_probe () | |
Constructs a light probe. More... | |
void | update_illuminance_matrices () |
Updates the light probe's illuminance matrices from its illuminance texture. More... | |
void | set_luminance_texture (std::shared_ptr< gl::texture_cube > texture) |
Sets the light probe's luminance texture. More... | |
void | set_luminance_outdated (bool outdated) |
Marks the light probe's luminance as either outdated or current. More... | |
void | set_illuminance_outdated (bool outdated) |
Marks the light probe's illuminance as either outdated or current. More... | |
const std::shared_ptr< gl::texture_cube > & | get_luminance_texture () const noexcept |
Returns the light probe's luminance texture. More... | |
const std::vector< std::shared_ptr< gl::framebuffer > > & | get_luminance_framebuffers () const noexcept |
Returns the light probe's luminance framebuffers. More... | |
const std::shared_ptr< gl::texture_1d > & | get_illuminance_texture () const noexcept |
Returns the light probe's illuminance texture. More... | |
const std::shared_ptr< gl::framebuffer > & | get_illuminance_framebuffer () const noexcept |
Returns the light probe's illuminance framebuffer. More... | |
std::span< const math::fmat4, 3 > | get_illuminance_matrices () const noexcept |
Returns the light probe's illuminance matrices. More... | |
bool | is_luminance_outdated () const noexcept |
Returns true if the light probe's luminance is outdated. More... | |
bool | is_illuminance_outdated () const noexcept |
Returns true if the light probe's illuminance is outdated. More... | |
const aabb_type & | get_bounds () const noexcept override |
Returns the bounds of the object. More... | |
![]() | |
const std::size_t | get_object_type_id () const noexcept final |
Returns the type ID for this scene object type. More... | |
![]() | |
virtual void | render (render::context &ctx) const |
Adds render operations to a render context. More... | |
void | look_at (const vector_type &position, const vector_type &target, const vector_type &up) |
constexpr void | set_layer_mask (std::uint32_t mask) noexcept |
Sets the layer mask of the object. More... | |
void | set_transform (const transform_type &transform) |
Sets the transform of the object. More... | |
void | set_translation (const vector_type &translation) |
Sets the translation of the object. More... | |
void | set_rotation (const quaternion_type &rotation) |
Sets the rotation of the object. More... | |
constexpr std::uint32_t | get_layer_mask () const noexcept |
Returns the layer mask of the object. More... | |
constexpr const transform_type & | get_transform () const noexcept |
Returns the transform of the object. More... | |
constexpr const vector_type & | get_translation () const noexcept |
Returns the translation of the object. More... | |
constexpr const quaternion_type & | get_rotation () const noexcept |
Returns the rotation of the object. More... | |
constexpr const vector_type & | get_scale () const noexcept |
Returns the scale of the object. More... | |
void | set_scale (const vector_type &scale) |
Sets the scale of the object. More... | |
void | set_scale (float scale) |
Sets the scale of the object. More... | |
Additional Inherited Members | |
![]() | |
using | vector_type = math::fvec3 |
using | quaternion_type = math::fquat |
using | transform_type = math::transform< float > |
using | aabb_type = geom::box< float > |
![]() | |
static const std::atomic< std::size_t > | object_type_id |
Unique type ID for this scene object type. More... | |
![]() | |
static std::size_t | next_object_type_id () |
![]() | |
std::uint32_t | m_layer_mask {1} |
transform_type | m_transform {transform_type::identity()} |
Definition at line 36 of file light-probe.hpp.
scene::light_probe::light_probe | ( | ) |
Constructs a light probe.
Definition at line 24 of file light-probe.cpp.
|
inlineoverridevirtualnoexcept |
Returns the bounds of the object.
Implements scene::object_base.
Definition at line 127 of file light-probe.hpp.
|
inlinenoexcept |
Returns the light probe's illuminance framebuffer.
Definition at line 96 of file light-probe.hpp.
|
inlinenoexcept |
Returns the light probe's illuminance matrices.
Definition at line 110 of file light-probe.hpp.
|
inlinenoexcept |
Returns the light probe's illuminance texture.
The illuminance texture is a 12x1 RGBA floating-point LUT which encodes the column vectors of three spherical harmonics illuminance matrices in the layout R0,R1,R2,R3,G0,G1,G2,G3,B0,B1,B2,B3
. The matrices R
, G
, and B
can be used to recover illuminance of the red, green, and blue color channels, respectively, for a given surface normal, n
, as follows: (dot(n, R * n), dot(n, G * n), dot(n, B * n))
, where n = (x, y, z, 1)
.
Definition at line 90 of file light-probe.hpp.
|
inlinenoexcept |
Returns the light probe's luminance framebuffers.
Definition at line 80 of file light-probe.hpp.
|
inlinenoexcept |
Returns the light probe's luminance texture.
Definition at line 74 of file light-probe.hpp.
|
inlinenoexcept |
Returns true
if the light probe's illuminance is outdated.
Definition at line 122 of file light-probe.hpp.
|
inlinenoexcept |
Returns true
if the light probe's luminance is outdated.
Definition at line 116 of file light-probe.hpp.
void scene::light_probe::set_illuminance_outdated | ( | bool | outdated | ) |
Marks the light probe's illuminance as either outdated or current.
outdated | true if the light probe's illuminance is outdated, false otherwise. |
Definition at line 121 of file light-probe.cpp.
void scene::light_probe::set_luminance_outdated | ( | bool | outdated | ) |
Marks the light probe's luminance as either outdated or current.
outdated | true if the light probe's luminance is outdated, false otherwise. |
Definition at line 116 of file light-probe.cpp.
void scene::light_probe::set_luminance_texture | ( | std::shared_ptr< gl::texture_cube > | texture | ) |
Sets the light probe's luminance texture.
texture | Luminance cubemap texture. |
Definition at line 79 of file light-probe.cpp.
void scene::light_probe::update_illuminance_matrices | ( | ) |
Updates the light probe's illuminance matrices from its illuminance texture.
Definition at line 63 of file light-probe.cpp.