Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
DebugLightRenderer.hpp
1#pragma once
2
3#include "scene/Scene.hpp"
4
5#include "renderers/LightRenderer.hpp"
6#include "scene/lights/Light.hpp"
7#include "scene/lights/PointLight.hpp"
8#include "scene/lights/DirectionalLight.hpp"
9#include "scene/lights/SpotLight.hpp"
10
11#include "Common.hpp"
12
17class DebugLightRenderer final : public LightRenderer {
18
19public:
23 explicit DebugLightRenderer(const std::string & fragmentShader);
24
29 void updateCameraInfos(const glm::mat4 & viewMatrix, const glm::mat4 & projMatrix);
30
34 void draw(const SpotLight * light) override;
35
39 void draw(const PointLight * light) override;
40
44 void draw(const DirectionalLight * light) override;
45
46private:
47
48 const Mesh * _sphere;
49 const Mesh * _cone;
50 const Mesh * _arrow;
51
53
54 glm::mat4 _view = glm::mat4(1.0f);
55 glm::mat4 _proj = glm::mat4(1.0f);
56};
Visualize lights as colored wireframe objects.
Definition: DebugLightRenderer.hpp:17
glm::mat4 _view
Cached camera view matrix.
Definition: DebugLightRenderer.hpp:54
const Mesh * _cone
Spot light supporting geometry.
Definition: DebugLightRenderer.hpp:49
const Mesh * _arrow
Spot light supporting geometry.
Definition: DebugLightRenderer.hpp:50
void draw(const SpotLight *light) override
Definition: DebugLightRenderer.cpp:16
Program * _program
Light mesh shader.
Definition: DebugLightRenderer.hpp:52
const Mesh * _sphere
Point light supporting geometry.
Definition: DebugLightRenderer.hpp:48
glm::mat4 _proj
Cached camera projection matrix.
Definition: DebugLightRenderer.hpp:55
void updateCameraInfos(const glm::mat4 &viewMatrix, const glm::mat4 &projMatrix)
Definition: DebugLightRenderer.cpp:11
A directional light, where all light rays have the same direction.
Definition: DirectionalLight.hpp:13
Base structure of a per-light specialized renderer.
Definition: LightRenderer.hpp:13
Represents a geometric mesh composed of vertices, other attributes and triangles.
Definition: Mesh.hpp:15
An omnidirectional punctual light, where light is radiating in all directions from a single point in ...
Definition: PointLight.hpp:15
Represents a group of shaders used for rendering.
Definition: Program.hpp:31
A spotlight, where light rays in a given cone are radiating from a single point in space....
Definition: SpotLight.hpp:13