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

Visualize lights as colored wireframe objects. More...

#include <DebugLightRenderer.hpp>

Public Member Functions

 DebugLightRenderer (const std::string &fragmentShader)
 
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

const Mesh_sphere
 Point light supporting geometry.
 
const Mesh_cone
 Spot light supporting geometry.
 
const Mesh_arrow
 Spot light supporting geometry.
 
Program_program
 Light mesh 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

Visualize lights as colored wireframe objects.

Inherits LightRenderer.

Constructor & Destructor Documentation

◆ DebugLightRenderer()

DebugLightRenderer::DebugLightRenderer ( const std::string &  fragmentShader)
explicit

Constructor.

See also
GLSL::Frag::light_debug for an example.
Parameters
fragmentShaderthe name of the fragment shader to use.

Member Function Documentation

◆ draw() [1/3]

void DebugLightRenderer::draw ( const DirectionalLight light)
overridevirtual

Draw a directional light as a colored wireframe arrow pointing at the origin.

Parameters
lightthe light to draw

Implements LightRenderer.

◆ draw() [2/3]

void DebugLightRenderer::draw ( const PointLight light)
overridevirtual

Draw a point light as a colored wireframe sphere.

Parameters
lightthe light to draw

Implements LightRenderer.

◆ draw() [3/3]

void DebugLightRenderer::draw ( const SpotLight light)
overridevirtual

Draw a spot light as a colored wireframe cone.

Parameters
lightthe light to draw

Implements LightRenderer.

◆ updateCameraInfos()

void DebugLightRenderer::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: