Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
DebugRenderer.hpp
1#pragma once
2
3#include "DeferredLight.hpp"
4
5#include "renderers/DebugLightRenderer.hpp"
6
7#include "scene/Scene.hpp"
8#include "renderers/Renderer.hpp"
9
10#include "resources/Texture.hpp"
11
12
13#include "Common.hpp"
14
19class DebugRenderer final : public Renderer {
20
21public:
24 explicit DebugRenderer();
25
29 void setScene(const std::shared_ptr<Scene> & scene);
30
32 void draw(const Camera & camera, Texture* dstColor, Texture* dstDepth, uint layer = 0) override;
33
35 void interface() override;
36
38
39private:
40
42 enum class ProbeMode : int {
43 SHCOEFFS = 0,
44 RADIANCE = 1
45 };
46
48 void updateSceneMesh();
49
51 std::shared_ptr<Scene> _scene;
52
53 const Mesh * _sphere = nullptr;
57
61
63 float _probeRoughness = 0.0f;
64 bool _showLights = true;
65 bool _showProbe = true;
66 bool _showBoxes = true;
67 bool _showFrame = true;
68};
This class represents a camera as used in real-time rendering APIs. It provides a view and projection...
Definition: Camera.hpp:11
Visualize lights as colored wireframe objects.
Definition: DebugLightRenderer.hpp:17
Provide debuggging visualization for most scene elements.
Definition: DebugRenderer.hpp:19
float _probeRoughness
Radiance level to display.
Definition: DebugRenderer.hpp:63
void setScene(const std::shared_ptr< Scene > &scene)
Definition: DebugRenderer.cpp:79
const Mesh * _sphere
Sphere mesh.
Definition: DebugRenderer.hpp:53
std::shared_ptr< Scene > _scene
The scene to render.
Definition: DebugRenderer.hpp:51
void draw(const Camera &camera, Texture *dstColor, Texture *dstDepth, uint layer=0) override
Definition: DebugRenderer.cpp:88
bool _showFrame
Show world frame (grid and gizmo).
Definition: DebugRenderer.hpp:67
Program * _probeProgram
Light probe visu.
Definition: DebugRenderer.hpp:54
DebugLightRenderer _lightDebugRenderer
The lights debug renderer.
Definition: DebugRenderer.hpp:50
Program * _boxesProgram
Bounding boxes visu.
Definition: DebugRenderer.hpp:55
ProbeMode
Definition: DebugRenderer.hpp:42
@ RADIANCE
(preconvolved) radiance cubemap.
@ SHCOEFFS
Irradiance SH coeffs.
DebugRenderer()
Definition: DebugRenderer.cpp:7
Mesh _cubeLines
General wireframe cube.
Definition: DebugRenderer.hpp:60
void interface() override
Definition: DebugRenderer.cpp:219
Mesh _sceneBoxes
Bounding boxes of all scene objects.
Definition: DebugRenderer.hpp:58
Program * _frameProgram
Frame and gizmo visu.
Definition: DebugRenderer.hpp:56
ProbeMode _probeMode
Probe info to display.
Definition: DebugRenderer.hpp:62
void updateSceneMesh()
Definition: DebugRenderer.cpp:200
Mesh _frame
Gizmo and grid in world space.
Definition: DebugRenderer.hpp:59
bool _showProbe
Show probe data.
Definition: DebugRenderer.hpp:65
bool _showLights
Show lights wireframe.
Definition: DebugRenderer.hpp:64
bool _showBoxes
Show scene objects bounding boxes.
Definition: DebugRenderer.hpp:66
Represents a geometric mesh composed of vertices, other attributes and triangles.
Definition: Mesh.hpp:15
Represents a group of shaders used for rendering.
Definition: Program.hpp:31
Base structure of a renderer.
Definition: Renderer.hpp:10
Represents a texture containing one or more images, stored on the CPU and/or GPU.
Definition: Texture.hpp:12