3#include "scene/Scene.hpp"
5#include "renderers/LightRenderer.hpp"
6#include "renderers/shadowmaps/ShadowMap.hpp"
7#include "scene/lights/Light.hpp"
8#include "scene/lights/PointLight.hpp"
9#include "scene/lights/DirectionalLight.hpp"
10#include "scene/lights/SpotLight.hpp"
11#include "resources/Buffer.hpp"
43 void updateCameraInfos(
const glm::mat4 & viewMatrix,
const glm::mat4 & projMatrix);
67 const std::vector<const Texture *> &
shadowMaps()
const {
83 glm::mat4
_view = glm::mat4(1.0f);
84 glm::mat4
_proj = glm::mat4(1.0f);
123 const std::vector<const Texture *> &
envmaps()
const {
128 const std::vector<const Buffer *> &
shCoeffs()
const {
A directional light, where all light rays have the same direction.
Definition: DirectionalLight.hpp:13
Store lights data for forward rendering in a GPU buffer.
Definition: ForwardLight.hpp:20
size_t _currentCount
Number of lights to store.
Definition: ForwardLight.hpp:79
void updateCameraInfos(const glm::mat4 &viewMatrix, const glm::mat4 &projMatrix)
Definition: ForwardLight.cpp:18
glm::mat4 _view
Cached camera view matrix.
Definition: ForwardLight.hpp:83
std::vector< const Texture * > _shadowMaps
Shadow maps list.
Definition: ForwardLight.hpp:87
void draw(const SpotLight *light) override
Definition: ForwardLight.cpp:24
UniformBuffer< GPULight > _lightsData
GPU buffer.
Definition: ForwardLight.hpp:81
size_t count() const
Definition: ForwardLight.hpp:62
const std::vector< const Texture * > & shadowMaps() const
Definition: ForwardLight.hpp:67
size_t _currentId
Current insertion location.
Definition: ForwardLight.hpp:78
static const size_t _maxLightCount
Maximum allowed number of lights (see forward_lights.glsl).
Definition: ForwardLight.hpp:80
glm::mat4 _invView
Cached inverse view matrix.
Definition: ForwardLight.hpp:85
UniformBuffer< GPULight > & data()
Definition: ForwardLight.hpp:72
glm::mat4 _proj
Cached camera projection matrix.
Definition: ForwardLight.hpp:84
Store environment probes data for forward rendering in a GPU buffer.
Definition: ForwardLight.hpp:95
static const size_t _maxProbeCount
Maximum allowed number of probes (see forward_lights.glsl).
Definition: ForwardLight.hpp:141
size_t _currentId
Current insertion location.
Definition: ForwardLight.hpp:139
void draw(const LightProbe &probe)
Definition: ForwardLight.cpp:121
const std::vector< const Texture * > & envmaps() const
Definition: ForwardLight.hpp:123
std::vector< const Texture * > _probesMaps
Environment maps list.
Definition: ForwardLight.hpp:144
UniformBuffer< GPUProbe > & data()
Definition: ForwardLight.hpp:133
std::vector< const Buffer * > _probesCoeffs
Environment SH coeffs list.
Definition: ForwardLight.hpp:145
size_t count() const
Definition: ForwardLight.hpp:118
size_t _currentCount
Number of probes to store.
Definition: ForwardLight.hpp:140
const std::vector< const Buffer * > & shCoeffs() const
Definition: ForwardLight.hpp:128
UniformBuffer< GPUProbe > _probesData
GPU buffer.
Definition: ForwardLight.hpp:142
Store environment lighting for reflections.
Definition: LightProbe.hpp:12
Base structure of a per-light specialized renderer.
Definition: LightRenderer.hpp:13
An omnidirectional punctual light, where light is radiating in all directions from a single point in ...
Definition: PointLight.hpp:15
A spotlight, where light rays in a given cone are radiating from a single point in space....
Definition: SpotLight.hpp:13
Represent a light on the GPU for the forward renderer.
Definition: ForwardLight.hpp:25
glm::vec4 colorAndBias
Light tint and shadow bias.
Definition: ForwardLight.hpp:27
glm::vec4 directionAndPlane
Light direction and far plane distance.
Definition: ForwardLight.hpp:29
glm::vec4 angles
Cone inner and outer angles.
Definition: ForwardLight.hpp:31
glm::vec4 typeModeLayer
Light type, shadow mode and shadow map layer.
Definition: ForwardLight.hpp:30
glm::mat4 viewToLight
View to light matrix.
Definition: ForwardLight.hpp:26
glm::vec4 positionAndRadius
Light position and effect radius.
Definition: ForwardLight.hpp:28
Represent a probe on the GPU for the forward renderer.
Definition: ForwardLight.hpp:100
glm::vec4 extentAndSin
The cubemap parallax box half size, and the cubemap parallax box orientation (precomputed sin).
Definition: ForwardLight.hpp:104
glm::vec4 positionAndMip
The cubemap location and the mip.
Definition: ForwardLight.hpp:101
glm::vec4 centerAndCos
The cubemap parallax box center, and the cubemap parallax box orientation (precomputed cos).
Definition: ForwardLight.hpp:103
glm::vec4 sizeAndFade
The cubemap box effect size, and the size of its fading region on edges.
Definition: ForwardLight.hpp:102