Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
DeferredLight Class Referencefinal

Apply a light onto the lighting buffer using a geometric proxy (cone, sphere, screenquad). By processing all lights, the final lighting is accumulated in the buffer. More...

#include <DeferredLight.hpp>

Public Member Functions

 DeferredLight (const Texture *texAlbedo, const Texture *texNormals, const Texture *texDepth, const Texture *texEffects)
 
void updateCameraInfos (const glm::mat4 &viewMatrix, const glm::mat4 &projMatrix)
 
void draw (const SpotLight *light) override
 
void draw (const PointLight *light) override
 
void draw (const DirectionalLight *light) override
 
virtual void draw (const DirectionalLight *light)=0
 
virtual void draw (const PointLight *light)=0
 
virtual void draw (const SpotLight *light)=0
 

Private Attributes

std::vector< const Texture * > _textures
 G-buffer input textures.
 
const Mesh_sphere
 Point light supporting geometry.
 
const Mesh_cone
 Spot light supporting geometry.
 
Program_dirProgram
 Directional light shader.
 
Program_pointProgram
 Point light shader.
 
Program_spotProgram
 Spot light shader.
 
glm::mat4 _view = glm::mat4(1.0f)
 Cached camera view matrix.
 
glm::mat4 _proj = glm::mat4(1.0f)
 Cached camera projection matrix.
 

Detailed Description

Apply a light onto the lighting buffer using a geometric proxy (cone, sphere, screenquad). By processing all lights, the final lighting is accumulated in the buffer.

See also
GPUShaders::Frag::Spot_light_pbr, GPUShaders::Frag::Point_light_pbr, GPUShaders::Frag::Directional_light_pbr

Inherits LightRenderer.

Constructor & Destructor Documentation

◆ DeferredLight()

DeferredLight::DeferredLight ( const Texture texAlbedo,
const Texture texNormals,
const Texture texDepth,
const Texture texEffects 
)
explicit

Constructor.

Parameters
texAlbedothe texture containing the albedo
texNormalsthe texture containing the surface normals
texDepththe texture containing the depth
texEffectsthe texture containing the material properties

Member Function Documentation

◆ draw() [1/3]

void DeferredLight::draw ( const DirectionalLight light)
overridevirtual

Apply a directional lighting using a supporting quad.

Parameters
lightthe light to compute the contribution of

Implements LightRenderer.

◆ draw() [2/3]

void DeferredLight::draw ( const PointLight light)
overridevirtual

Apply a point lighting using a supporting sphere.

Parameters
lightthe light to compute the contribution of

Implements LightRenderer.

◆ draw() [3/3]

void DeferredLight::draw ( const SpotLight light)
overridevirtual

Apply a spot lighting using a supporting cone.

Parameters
lightthe light to compute the contribution of

Implements LightRenderer.

◆ updateCameraInfos()

void DeferredLight::updateCameraInfos ( const glm::mat4 &  viewMatrix,
const glm::mat4 &  projMatrix 
)

Set the current user view and projection matrices.

Parameters
viewMatrixthe camera view matrix
projMatrixthe camera projection matrix

The documentation for this class was generated from the following files: