Store environment lighting for reflections.
More...
#include <LightProbe.hpp>
|
const Texture * | _envmap = nullptr |
| The environment map.
|
|
std::shared_ptr< Buffer > | _shCoeffs |
| The irradiance representation.
|
|
Type | _type = Type::DYNAMIC |
| The type of probe.
|
|
glm::vec3 | _position = glm::vec3(0.0f) |
| The probe location.
|
|
glm::vec3 | _size = glm::vec3(1e10f) |
| The probe area of effect.
|
|
glm::vec3 | _extent = glm::vec3(-1.0f) |
| The probe parallax proxy extent.
|
|
glm::vec3 | _center = glm::vec3(0.0f) |
| The probe parallax proxy center.
|
|
glm::vec2 | _rotCosSin = glm::vec2(1.0f, 0.0f) |
| Probe orientation trigonometric cached values.
|
|
float | _fade = 1e-8f |
| The probe effect fading margin around its area of effect.
|
|
float | _rotation = 0.0f |
| The probe orientation around a vertical axis,.
|
|
Store environment lighting for reflections.
◆ Type
The type of probe.
Enumerator |
---|
STATIC | Loaded from disk, never updated.
|
DYNAMIC | Generated in engine.
|
◆ LightProbe()
LightProbe::LightProbe |
( |
| ) |
|
|
explicitdefault |
◆ center()
const glm::vec3 & LightProbe::center |
( |
| ) |
const |
|
inline |
- Returns
- the probe parallax proxy center
◆ decode()
Setup the probe parameters from a list of key-value tuples. The following representations are possible: either:
* probe:
radiance: texturetype: ...
irradiance: shcoeffs_filename
for a static environment map or
* probe:
position: X,Y,Z
size: W,H,D
fade: distance
center: X,Y,Z
extent: W,H,D
rotation: angle
for a probe renderered on the fly at the given location. center, extent and rotation are used to define an oriented box used as a local scene proxy. If extent is negative, the environment is assumed to be at infinity. position, size, fade and rotation are used to define a box-shaped area of effect with soft edges. Both size and extent are half-sizes.
- Parameters
-
params | the parameters tuple |
options | data loading and storage options |
- Returns
- decoding status
◆ encode()
Generate a key-values representation of the probe. See decode for the keywords and layout.
- Returns
- a tuple representing the probe.
◆ extent()
const glm::vec3 & LightProbe::extent |
( |
| ) |
const |
|
inline |
- Returns
- the probe parallax proxy extent half size (or -1 for probes at infinity)
◆ fade()
float LightProbe::fade |
( |
| ) |
const |
|
inline |
- Returns
- the probe fading band width, at the edges of its area of effect
◆ map()
const Texture * LightProbe::map |
( |
| ) |
const |
|
inline |
- Returns
- the environment map
◆ position()
const glm::vec3 & LightProbe::position |
( |
| ) |
const |
|
inline |
- Returns
- the probe position (or the origin for static probes)
◆ registerEnvironment()
void LightProbe::registerEnvironment |
( |
const Texture * |
envmap, |
|
|
const std::shared_ptr< Buffer > & |
shCoeffs |
|
) |
| |
Register an environment, potentially updated on the fly.
- Parameters
-
envmap | the new map to use |
shCoeffs | the new irradiance coefficients |
◆ rotation()
const float & LightProbe::rotation |
( |
| ) |
const |
|
inline |
- Returns
- the probe orientation.
◆ rotationCosSin()
const glm::vec2 & LightProbe::rotationCosSin |
( |
| ) |
const |
|
inline |
- Returns
- the probe precomputed orientation (cos(angleY), sin(angleY)).
◆ shCoeffs()
const std::shared_ptr< Buffer > & LightProbe::shCoeffs |
( |
| ) |
const |
|
inline |
- Returns
- the irradiance coefficients buffer
◆ size()
const glm::vec3 & LightProbe::size |
( |
| ) |
const |
|
inline |
- Returns
- the half size of the probe area of effect
◆ type()
Type LightProbe::type |
( |
| ) |
const |
|
inline |
◆ updateSize()
void LightProbe::updateSize |
( |
const BoundingBox & |
_bbox | ) |
|
Update the area of effect of the probe to ensure it's not bigger than the specified bounding box
- Parameters
-
_bbox | the maximum size of the probe box |
The documentation for this class was generated from the following files: