Radium Engine  1.5.20
Loading...
Searching...
No Matches
ForwardRenderer.hpp
1#pragma once
2
3#include <Engine/Rendering/Renderer.hpp>
4
5namespace globjects {
6class Framebuffer;
7}
8
9namespace Ra {
10namespace Engine {
11namespace Data {
12class Texture;
13}
14namespace Rendering {
15
23class RA_ENGINE_API ForwardRenderer : public Renderer
24{
25 public:
27 ~ForwardRenderer() override;
28
29 std::string getRendererName() const override { return "Forward Renderer"; }
30 bool buildRenderTechnique( RenderObject* ro ) const override;
31
32 protected:
33 void initializeInternal() override;
34 void resizeInternal() override;
35
36 void updateStepInternal( const Data::ViewingParameters& renderData ) override;
37
38 void postProcessInternal( const Data::ViewingParameters& renderData ) override;
39 void renderInternal( const Data::ViewingParameters& renderData ) override;
40 void debugInternal( const Data::ViewingParameters& renderData ) override;
41 void uiInternal( const Data::ViewingParameters& renderData ) override;
42
43 private:
44 void initShaders();
45 void initBuffers();
46
47 void updateShadowMaps();
48
49 protected:
53 virtual void renderBackground( const Data::ViewingParameters& ) {}
54
55 enum RendererTextures {
56 RendererTextures_Depth = 0, // need to be the first, since used for other textures init
57 RendererTextures_HDR,
58 RendererTextures_Normal,
59 RendererTextures_Diffuse,
60 RendererTextures_Specular,
61 RendererTextures_OITAccum,
62 RendererTextures_OITRevealage,
63 RendererTextures_Volume,
64 RendererTexture_Count
65 };
66 std::array<std::string, RendererTexture_Count> m_textureNames { { "Depth (fw)",
67 "HDR",
68 "Normal",
69 "Diffuse",
70 "Specular",
71 "OIT Accum",
72 "OIT Revealage",
73 "Volume" } };
74
75 // Default renderer logic here, no need to be accessed by overriding renderers.
81
82 std::vector<RenderObjectPtr> m_transparentRenderObjects;
83 size_t m_fancyTransparentCount { 0 };
84
85 std::vector<RenderObjectPtr> m_volumetricRenderObjects;
86 size_t m_fancyVolumetricCount { 0 };
87
88 size_t m_pingPongSize { 0 };
89
90 std::array<std::unique_ptr<Data::Texture>, RendererTexture_Count> m_textures;
91
92 static const size_t ShadowMapSize { 1024 };
94 std::vector<Core::Matrix4> m_lightMatrices;
95
97 WireMap m_wireframes;
98};
99
100} // namespace Rendering
101} // namespace Engine
102} // namespace Ra
virtual void renderBackground(const Data::ViewingParameters &)
Draw the picture background. This method allows custom renderers to draw objects on the background....
std::string getRendererName() const override
Get the name of the renderer, e.g to be displayed in the UI.
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:3
the set of viewing parameters extracted from the camera and given to the renderer