3#include "resources/Buffer.hpp"
4#include "resources/ResourcesManager.hpp"
5#include "resources/Texture.hpp"
6#include "renderers/Renderer.hpp"
7#include "input/Camera.hpp"
31 Probe(
LightProbe & probe, std::shared_ptr<Renderer> renderer, uint size, uint mips,
const glm::vec2 & clippingPlanes);
Store environment lighting for reflections.
Definition: LightProbe.hpp:12
A probe can be used to capture the appareance of a scene at a given location as a 360° cubemap.
Definition: Probe.hpp:19
static void extractIrradianceSHCoeffs(const Texture &cubemap, float clamp, std::vector< glm::vec3 > &shCoeffs)
Decompose an existing cubemap irradiance onto the nine first elements of the spherical harmonic basis...
Definition: Probe.cpp:116
uint _substepRadiance
If convolving radiance, current level.
Definition: Probe.hpp:103
uint totalBudget() const
Definition: Probe.cpp:202
Texture _result
The cubemap content.
Definition: Probe.hpp:85
ProbeState
Probe update state machine.
Definition: Probe.hpp:95
@ CONVOLVE_RADIANCE
Convolving the cubemap to generate radiance for a given roughness level.
@ DRAW_FACES
Drawing a cubemap face with the environment.
@ GENERATE_IRRADIANCE
Integrate irradiance in a compute shader.
std::shared_ptr< Buffer > _shCoeffs
SH representation of the cubemap irradiance.
Definition: Probe.hpp:87
Probe & operator=(Probe &&)=delete
Texture _copy
Downscaled copy of the cubemap content.
Definition: Probe.hpp:86
Probe & operator=(const Probe &)=delete
void estimateIrradiance(float clamp)
Definition: Probe.cpp:101
void convolveRadiance(float clamp, uint layer)
Definition: Probe.cpp:80
glm::vec3 _position
The probe location.
Definition: Probe.hpp:90
Program * _irradianceCompute
Irradiance SH projection shader.
Definition: Probe.hpp:92
Probe(const Probe &)=delete
uint _substepDraw
If drawing, current face.
Definition: Probe.hpp:102
std::array< Camera, 6 > _cameras
Camera for each face.
Definition: Probe.hpp:89
void update(uint budget)
Definition: Probe.cpp:31
Program * _radianceCompute
Radiance preconvolution shader.
Definition: Probe.hpp:91
std::shared_ptr< Renderer > _renderer
The renderer to use.
Definition: Probe.hpp:84
ProbeState _currentState
Current update state.
Definition: Probe.hpp:101
Represents a group of shaders used for rendering.
Definition: Program.hpp:31
Represents a texture containing one or more images, stored on the CPU and/or GPU.
Definition: Texture.hpp:12