Merge 'remotes/trunk'
[0ad.git] / source / renderer / SilhouetteRenderer.h
blob485e4d4a1dae94540822ac24e59bf53e4e065775
1 /* Copyright (C) 2014 Wildfire Games.
2 * This file is part of 0 A.D.
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.
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.
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/>.
18 #ifndef INCLUDED_SILHOUETTERENDERER
19 #define INCLUDED_SILHOUETTERENDERER
21 #include "graphics/Overlay.h"
22 #include "maths/BoundingBoxAligned.h"
24 class CCamera;
25 class CModel;
26 class CPatch;
27 class SceneCollector;
29 class SilhouetteRenderer
31 public:
32 SilhouetteRenderer();
34 void AddOccluder(CPatch* patch);
35 void AddOccluder(CModel* model);
36 void AddCaster(CModel* model);
38 void ComputeSubmissions(const CCamera& camera);
39 void RenderSubmitOverlays(SceneCollector& collector);
40 void RenderSubmitOccluders(SceneCollector& collector);
41 void RenderSubmitCasters(SceneCollector& collector);
43 void RenderDebugOverlays(const CCamera& camera);
45 void EndFrame();
47 private:
48 bool m_DebugEnabled;
50 std::vector<CPatch*> m_SubmittedPatchOccluders;
51 std::vector<CModel*> m_SubmittedModelOccluders;
52 std::vector<CModel*> m_SubmittedModelCasters;
54 std::vector<CPatch*> m_VisiblePatchOccluders;
55 std::vector<CModel*> m_VisibleModelOccluders;
56 std::vector<CModel*> m_VisibleModelCasters;
58 struct DebugBounds
60 CColor color;
61 CBoundingBoxAligned bounds;
64 struct DebugRect
66 CColor color;
67 u16 x0, y0, x1, y1;
70 std::vector<DebugBounds> m_DebugBounds;
71 std::vector<DebugRect> m_DebugRects;
73 std::vector<SOverlaySphere> m_DebugSpheres;
76 #endif // INCLUDED_SILHOUETTERENDERER