Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
SilhouetteRenderer.h
Go to the documentation of this file.
1/* Copyright (C) 2023 Wildfire Games.
2 * This file is part of 0 A.D.
3 *
4 * 0 A.D. is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * 0 A.D. is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef INCLUDED_SILHOUETTERENDERER
19#define INCLUDED_SILHOUETTERENDERER
20
21#include "graphics/Overlay.h"
26
27class CCamera;
28class CModel;
29class CPatch;
30class SceneCollector;
31
33{
34public:
36
37 void AddOccluder(CPatch* patch);
38 void AddOccluder(CModel* model);
39 void AddCaster(CModel* model);
40
41 void ComputeSubmissions(const CCamera& camera);
42 void RenderSubmitOverlays(SceneCollector& collector);
44 void RenderSubmitCasters(SceneCollector& collector);
45
47 Renderer::Backend::IDeviceCommandContext* deviceCommandContext);
49 Renderer::Backend::IDeviceCommandContext* deviceCommandContext);
50
51 void EndFrame();
52
53private:
55
56 std::vector<CPatch*> m_SubmittedPatchOccluders;
57 std::vector<CModel*> m_SubmittedModelOccluders;
58 std::vector<CModel*> m_SubmittedModelCasters;
59
60 std::vector<CPatch*> m_VisiblePatchOccluders;
61 std::vector<CModel*> m_VisibleModelOccluders;
62 std::vector<CModel*> m_VisibleModelCasters;
63
65 {
68 };
69
70 struct DebugRect
71 {
73 float x0, y0, x1, y1;
74 };
75
76 std::vector<DebugBounds> m_DebugBounds;
77 std::vector<DebugRect> m_DebugRects;
78
79 std::vector<SOverlaySphere> m_DebugSpheres;
80
83};
84
85#endif // INCLUDED_SILHOUETTERENDERER
std::shared_ptr< CShaderTechnique > CShaderTechniquePtr
Definition: ShaderTechniquePtr.h:28
Definition: BoundingBoxAligned.h:34
Definition: Camera.h:42
Definition: Model.h:39
Definition: Patch.h:49
Definition: IDeviceCommandContext.h:42
IVertexInputLayout stores precompiled list of vertex attributes.
Definition: IShaderProgram.h:74
This interface accepts renderable objects.
Definition: Scene.h:90
Definition: SilhouetteRenderer.h:33
std::vector< CPatch * > m_VisiblePatchOccluders
Definition: SilhouetteRenderer.h:60
std::vector< CModel * > m_VisibleModelOccluders
Definition: SilhouetteRenderer.h:61
std::vector< SOverlaySphere > m_DebugSpheres
Definition: SilhouetteRenderer.h:79
void EndFrame()
Definition: SilhouetteRenderer.cpp:524
void ComputeSubmissions(const CCamera &camera)
Definition: SilhouetteRenderer.cpp:211
bool m_DebugEnabled
Definition: SilhouetteRenderer.h:54
void AddOccluder(CPatch *patch)
Definition: SilhouetteRenderer.cpp:46
void RenderDebugOverlays(Renderer::Backend::IDeviceCommandContext *deviceCommandContext)
Definition: SilhouetteRenderer.cpp:456
std::vector< CModel * > m_SubmittedModelCasters
Definition: SilhouetteRenderer.h:58
void AddCaster(CModel *model)
Definition: SilhouetteRenderer.cpp:56
void RenderSubmitOverlays(SceneCollector &collector)
Definition: SilhouetteRenderer.cpp:425
std::vector< CModel * > m_VisibleModelCasters
Definition: SilhouetteRenderer.h:62
std::vector< DebugBounds > m_DebugBounds
Definition: SilhouetteRenderer.h:76
std::vector< DebugRect > m_DebugRects
Definition: SilhouetteRenderer.h:77
void RenderSubmitOccluders(SceneCollector &collector)
Definition: SilhouetteRenderer.cpp:431
std::vector< CPatch * > m_SubmittedPatchOccluders
Definition: SilhouetteRenderer.h:56
CShaderTechniquePtr m_ShaderTech
Definition: SilhouetteRenderer.h:81
std::vector< CModel * > m_SubmittedModelOccluders
Definition: SilhouetteRenderer.h:57
Renderer::Backend::IVertexInputLayout * m_VertexInputLayout
Definition: SilhouetteRenderer.h:82
void RenderSubmitCasters(SceneCollector &collector)
Definition: SilhouetteRenderer.cpp:440
void RenderDebugBounds(Renderer::Backend::IDeviceCommandContext *deviceCommandContext)
Definition: SilhouetteRenderer.cpp:446
SilhouetteRenderer()
Definition: SilhouetteRenderer.cpp:41
Definition: Color.h:43
Definition: SilhouetteRenderer.h:65
CColor color
Definition: SilhouetteRenderer.h:66
CBoundingBoxAligned bounds
Definition: SilhouetteRenderer.h:67
Definition: SilhouetteRenderer.h:71
float y1
Definition: SilhouetteRenderer.h:73
CColor color
Definition: SilhouetteRenderer.h:72
float x1
Definition: SilhouetteRenderer.h:73
float x0
Definition: SilhouetteRenderer.h:73
float y0
Definition: SilhouetteRenderer.h:73