1#ifndef OE_RENDER_LIGHTING_H
2#define OE_RENDER_LIGHTING_H
6#include "../scene/lighting.h"
9#include "shader_base.h"
24 std::shared_ptr<Cubemap> irradiance =
nullptr;
25 std::shared_ptr<Cubemap> specular =
nullptr;
55 shader->setVec3Array(
"uPointLightPositions", _point_light_positions);
56 shader->setVec3Array(
"uPointLightColors", _point_light_colors);
58 shader->fillTextures({
59 {
"uBRDF", {10, _brdf_texture.get()}}
69 if (!_default_reflection_probe.specular || !_default_reflection_probe.irradiance)
74 shader->fillCubemaps({
75 {
"uDefaultIrradiance", {12, _default_reflection_probe.irradiance.get()}},
76 {
"uDefaultSpecular", {13, _default_reflection_probe.specular.get()}}
86 shader->fillTextures({
87 {
"uScreenTransparency", {15, _refraction_texture.get()}}
99 _refraction_texture = refraction_texture;
108 return _area_light_matrices;
117 std::vector<glm::vec3> _point_light_positions;
118 std::vector<glm::vec3> _point_light_colors;
120 std::vector<glm::mat4> _area_light_matrices;
126 std::shared_ptr<Texture> _brdf_texture;
127 std::shared_ptr<Texture> _refraction_texture;
Lighting manager (rendering)
Definition lighting.h:34
void fillShader(ShaderBase *shader) const noexcept
Send All lights data to the shader.
Definition lighting.h:53
void fillReflectionsShader(ShaderBase *shader) const noexcept
Send Reflection probes data to the shader.
Definition lighting.h:67
void setRefractionTexture(const std::shared_ptr< Texture > &refraction_texture)
Set texture that will be used as source for refractive surfaces.
Definition lighting.h:97
const std::vector< glm::mat4 > getAreaLights() const
Get Area lights Each one packed as a matrix where each xyz rows are the light edges,...
Definition lighting.h:106
Lighting()
Create the component.
void setDefaultReflectionProbe(Cubemap *cubemap, const uint32_t specular_size=256)
Set Default reflection source.
void update()
Update lighting.
void fillTransparencyShader(ShaderBase *shader) const noexcept
Send Transparency data (ie refractive buffer) to the shader.
Definition lighting.h:84
Physically Based Rendering.
Definition pbr.h:16
Shader class.
Definition shader_base.h:32
Render related abstractions (Shader, Framebuffer, Cubemaps, Textures)
Definition opengl.h:10
A reflection environment.
Definition lighting.h:23
Lighting manager (scene)
Definition lighting.h:66