Pyrogenesis  trunk
Renderer.h
Go to the documentation of this file.
1 /* Copyright (C) 2016 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 /*
19  * higher level interface on top of OpenGL to render basic objects:
20  * terrain, models, sprites, particles etc.
21  */
22 
23 #ifndef INCLUDED_RENDERER
24 #define INCLUDED_RENDERER
25 
26 #include "graphics/Camera.h"
27 #include "graphics/SColor.h"
29 #include "lib/file/vfs/vfs_path.h"
30 #include "lib/res/handle.h"
31 #include "ps/Singleton.h"
32 
33 #include "graphics/ShaderDefines.h"
34 #include "renderer/Scene.h"
35 
36 // necessary declarations
37 class CFontManager;
38 class CLightEnv;
39 class CMaterial;
40 class CMaterialManager;
41 class CModel;
42 class CParticleManager;
43 class CPatch;
44 class CPostprocManager;
45 class CShaderManager;
46 class CSimulation2;
47 class CTextureManager;
48 class CTimeManager;
49 class RenderPathVertexShader;
50 class ScriptInterface;
51 class SkyManager;
52 class TerrainRenderer;
53 class WaterManager;
54 
55 // rendering modes
57 
58 // transparency modes
60 
61 // access to sole renderer object
62 #define g_Renderer CRenderer::GetSingleton()
63 
64 ///////////////////////////////////////////////////////////////////////////////////////////
65 // CRenderer: base renderer class - primary interface to the rendering engine
66 struct CRendererInternals;
67 
68 class CRenderer :
69  public Singleton<CRenderer>,
70  private SceneCollector
71 {
72 public:
73  // various enumerations and renderer related constants
74  enum { NumAlphaMaps=14 };
75  enum Option {
92  };
93 
94  enum CullGroup {
102  };
103 
104  enum RenderPath {
105  // If no rendering path is configured explicitly, the renderer
106  // will choose the path when Open() is called.
108 
109  // Classic fixed function.
111 
112  // Use new ARB/GLSL system
114  };
115 
116  // stats class - per frame counts of number of draw calls, poly counts etc
117  struct Stats {
118  // set all stats to zero
119  void Reset() { memset(this, 0, sizeof(*this)); }
120  // number of draw calls per frame - total DrawElements + Begin/End immediate mode loops
121  size_t m_DrawCalls;
122  // number of terrain triangles drawn
124  // number of water triangles drawn
125  size_t m_WaterTris;
126  // number of (non-transparent) model triangles drawn
127  size_t m_ModelTris;
128  // number of overlay triangles drawn
130  // number of splat passes for alphamapping
132  // number of particles
133  size_t m_Particles;
134  };
135 
136  // renderer options
137  struct Options {
138  bool m_NoVBO;
139  bool m_Shadows;
140 
147 
158  bool m_ShowSky;
161  } m_Options;
162 
163  struct Caps {
164  bool m_VBO;
169  bool m_Shadows;
171  };
172 
173 public:
174  // constructor, destructor
175  CRenderer();
176  ~CRenderer();
177 
178  // open up the renderer: performs any necessary initialisation
179  bool Open(int width,int height);
180 
181  // resize renderer view
182  void Resize(int width,int height);
183 
184  // set/get boolean renderer option
185  void SetOptionBool(enum Option opt, bool value);
186  bool GetOptionBool(enum Option opt) const;
187  void SetRenderPath(RenderPath rp);
189  static CStr GetRenderPathName(RenderPath rp);
190  static RenderPath GetRenderPathByName(const CStr& name);
191 
192  // return view width
193  int GetWidth() const { return m_Width; }
194  // return view height
195  int GetHeight() const { return m_Height; }
196  // return view aspect ratio
197  float GetAspect() const { return float(m_Width)/float(m_Height); }
198 
199  // signal frame start
200  void BeginFrame();
201  // signal frame end
202  void EndFrame();
203 
204  /**
205  * Set simulation context for rendering purposes.
206  * Must be called at least once when the game has started and before
207  * frames are rendered.
208  */
209  void SetSimulation(CSimulation2* simulation);
210 
211  // set color used to clear screen in BeginFrame()
212  void SetClearColor(SColor4ub color);
213 
214  // trigger a reload of shaders (when parameters they depend on have changed)
215  void MakeShadersDirty();
216 
217  /**
218  * Set up the camera used for rendering the next scene; this includes
219  * setting OpenGL state like viewport, projection and modelview matrices.
220  *
221  * @param viewCamera this camera determines the eye position for rendering
222  * @param cullCamera this camera determines the frustum for culling in the renderer and
223  * for shadow calculations
224  */
225  void SetSceneCamera(const CCamera& viewCamera, const CCamera& cullCamera);
226 
227  // set the viewport
228  void SetViewport(const SViewPort &);
229 
230  // get the last viewport
232 
233  /**
234  * Render the given scene immediately.
235  * @param scene a Scene object describing what should be rendered.
236  */
237  void RenderScene(Scene& scene);
238 
239  /**
240  * Return the scene that is currently being rendered.
241  * Only valid when the renderer is in a RenderScene call.
242  */
243  Scene& GetScene();
244 
245  /**
246  * Render text overlays on top of the scene.
247  * Assumes the caller has set up the GL environment for orthographic rendering
248  * with texturing and blending.
249  */
250  void RenderTextOverlays();
251 
252  // set the current lighting environment; (note: the passed pointer is just copied to a variable within the renderer,
253  // so the lightenv passed must be scoped such that it is not destructed until after the renderer is no longer rendering)
254  void SetLightEnv(CLightEnv* lightenv) {
255  m_LightEnv=lightenv;
256  }
257 
258  // set the mode to render subsequent terrain patches
260  // get the mode to render subsequent terrain patches
262 
263  // set the mode to render subsequent models
265  // get the mode to render subsequent models
267 
268  // debugging
269  void SetDisplayTerrainPriorities(bool enabled) { m_DisplayTerrainPriorities = enabled; }
270 
271  // bind a GL texture object to active unit
272  void BindTexture(int unit, unsigned int tex);
273 
274  // load the default set of alphamaps.
275  // return a negative error code if anything along the way fails.
276  // called via delay-load mechanism.
277  int LoadAlphaMaps();
278  void UnloadAlphaMaps();
279 
280  // return stats accumulated for current frame
281  Stats& GetStats() { return m_Stats; }
282 
283  // return the current light environment
284  const CLightEnv &GetLightEnv() { return *m_LightEnv; }
285 
286  // return the current view camera
287  const CCamera& GetViewCamera() const { return m_ViewCamera; }
288  // replace the current view camera
289  void SetViewCamera(const CCamera& camera) { m_ViewCamera = camera; }
290 
291  // return the current cull camera
292  const CCamera& GetCullCamera() const { return m_CullCamera; }
293 
294  /**
295  * GetWaterManager: Return the renderer's water manager.
296  *
297  * @return the WaterManager object used by the renderer
298  */
300 
301  /**
302  * GetSkyManager: Return the renderer's sky manager.
303  *
304  * @return the SkyManager object used by the renderer
305  */
307 
309 
311 
313 
315 
317 
319 
321 
323 
325 
326  /**
327  * GetCapabilities: Return which OpenGL capabilities are available and enabled.
328  *
329  * @return capabilities structure
330  */
331  const Caps& GetCapabilities() const { return m_Caps; }
332 
333  static void RegisterScriptFunctions(ScriptInterface& scriptInterface);
334 
335  /**
336  * Resets the render state to default, that was before a game started
337  */
338  void ResetState();
339 
340 protected:
341  friend struct CRendererInternals;
342  friend class CVertexBuffer;
343  friend class CPatchRData;
344  friend class CDecalRData;
346  friend class ModelRenderer;
348  friend class SortModelRenderer;
354  friend class TerrainRenderer;
355  friend class WaterRenderer;
356 
357  //BEGIN: Implementation of SceneCollector
358  void Submit(CPatch* patch);
359  void Submit(SOverlayLine* overlay);
360  void Submit(SOverlayTexturedLine* overlay);
361  void Submit(SOverlaySprite* overlay);
362  void Submit(SOverlayQuad* overlay);
363  void Submit(CModelDecal* decal);
364  void Submit(CParticleEmitter* emitter);
365  void Submit(SOverlaySphere* overlay);
367  //END: Implementation of SceneCollector
368 
369  // render any batched objects
370  void RenderSubmissions(const CBoundingBoxAligned& waterScissor);
371 
372  // patch rendering stuff
373  void RenderPatches(const CShaderDefines& context, int cullGroup);
374 
375  // model rendering stuff
376  void RenderModels(const CShaderDefines& context, int cullGroup);
377  void RenderTransparentModels(const CShaderDefines& context, int cullGroup, ETransparentMode transparentMode, bool disableFaceCulling);
378 
379  void RenderSilhouettes(const CShaderDefines& context);
380 
381  void RenderParticles(int cullGroup);
382 
383  // shadow rendering stuff
384  void RenderShadowMap(const CShaderDefines& context);
385 
386  // render water reflection and refraction textures
387  void RenderReflections(const CShaderDefines& context, const CBoundingBoxAligned& scissor);
388  void RenderRefractions(const CShaderDefines& context, const CBoundingBoxAligned& scissor);
389 
390  void ComputeReflectionCamera(CCamera& camera, const CBoundingBoxAligned& scissor) const;
391  void ComputeRefractionCamera(CCamera& camera, const CBoundingBoxAligned& scissor) const;
392 
393  // debugging
394  void DisplayFrustum();
395 
396  // enable oblique frustum clipping with the given clip plane
397  void SetObliqueFrustumClipping(CCamera& camera, const CVector4D& clipPlane) const;
398 
399  void ReloadShaders();
401 
402  // hotloading
403  static Status ReloadChangedFileCB(void* param, const VfsPath& path);
404 
405  // RENDERER DATA:
406  /// Private data that is not needed by inline functions
408  // view width
409  int m_Width;
410  // view height
411  int m_Height;
412  // current terrain rendering mode
414  // current model rendering mode
416 
418 
420 
421  /**
422  * m_ViewCamera: determines the eye position for rendering
423  *
424  * @see CGameView::m_ViewCamera
425  */
427 
428  /**
429  * m_CullCamera: determines the frustum for culling and shadowmap calculations
430  *
431  * @see CGameView::m_ViewCamera
432  */
434 
435  // only valid inside a call to RenderScene
438 
439  // color used to clear screen in BeginFrame
440  float m_ClearColor[4];
441  // current lighting setup
443  // ogl_tex handle of composite alpha map (all the alpha maps packed into one texture)
445  // coordinates of each (untransformed) alpha map within the packed texture
446  struct {
447  float u0,u1,v0,v1;
449  // card capabilities
451  // build card cap bits
452  void EnumCaps();
453  // per-frame renderer stats
455 
456  /**
457  * m_WaterManager: the WaterManager object used for water textures and settings
458  * (e.g. water color, water height)
459  */
461 
462  /**
463  * m_SkyManager: the SkyManager object used for sky textures and settings
464  */
466 
467  /**
468  * Enable rendering of terrain tile priority text overlay, for debugging.
469  */
471 
472 public:
473  /**
474  * m_ShadowZBias: Z bias used when rendering shadows into a depth texture.
475  * This can be used to control shadowing artifacts.
476  *
477  * Can be accessed via JS as renderer.shadowZBias
478  * ShadowMap uses this for matrix calculation.
479  */
481 
482  /**
483  * m_ShadowMapSize: Size of shadow map, or 0 for default. Typically slow but useful
484  * for high-quality rendering. Changes don't take effect until the shadow map
485  * is regenerated.
486  *
487  * Can be accessed via JS as renderer.shadowMapSize
488  */
490 
491  /**
492  * m_SkipSubmit: Disable the actual submission of rendering commands to OpenGL.
493  * All state setup is still performed as usual.
494  *
495  * Can be accessed via JS as renderer.skipSubmit
496  */
498 };
499 
500 
501 #endif
Render animated models using a ShaderRenderModifier.
Definition: HWLightingModelRenderer.h:35
bool m_ARBProgram
Definition: Renderer.h:165
Definition: Renderer.h:81
~CRenderer()
Definition: Renderer.cpp:480
ERenderMode m_TerrainRenderMode
Definition: Renderer.h:413
void SetDisplayTerrainPriorities(bool enabled)
Definition: Renderer.h:269
Definition: DecalRData.h:31
void ReloadShaders()
Definition: Renderer.cpp:557
void SetClearColor(SColor4ub color)
Definition: Renderer.cpp:876
bool m_ARBProgramShadow
Definition: Renderer.h:150
size_t m_ModelTris
Definition: Renderer.h:127
bool m_VBO
Definition: Renderer.h:164
Definition: Renderer.h:98
void ResetState()
Resets the render state to default, that was before a game started.
Definition: Renderer.cpp:2123
Definition: Renderer.h:59
int m_Height
Definition: Renderer.h:411
void RenderParticles(int cullGroup)
Definition: Renderer.cpp:1414
Line-based overlay, with world-space coordinates, rendered in the world potentially behind other obje...
Definition: Overlay.h:35
ERenderMode GetTerrainRenderMode() const
Definition: Renderer.h:261
bool m_Shadows
Definition: Renderer.h:169
CTimeManager & GetTimeManager()
Definition: Renderer.cpp:2103
Particle emitter.
Definition: ParticleEmitter.h:67
bool m_ShowSky
Definition: Renderer.h:158
void SetLightEnv(CLightEnv *lightenv)
Definition: Renderer.h:254
bool m_WaterUgly
Definition: Renderer.h:141
Definition: Camera.h:31
friend class ShaderInstancingModelRenderer
Definition: Renderer.h:353
size_t m_WaterTris
Definition: Renderer.h:125
SViewPort m_Viewport
Definition: Renderer.h:419
CullGroup
Definition: Renderer.h:94
Definition: Renderer.h:87
bool m_WaterShadows
Definition: Renderer.h:146
void ComputeReflectionCamera(CCamera &camera, const CBoundingBoxAligned &scissor) const
Definition: Renderer.cpp:1102
void Resize(int width, int height)
Definition: Renderer.cpp:659
void EnumCaps()
Definition: Renderer.cpp:493
bool m_SmoothLOS
Definition: Renderer.h:157
Definition: Renderer.h:99
static RenderPath GetRenderPathByName(const CStr &name)
Definition: Renderer.cpp:836
Definition: Renderer.h:59
Definition: Renderer.h:84
Definition: Renderer.h:56
void ComputeRefractionCamera(CCamera &camera, const CBoundingBoxAligned &scissor) const
Definition: Renderer.cpp:1141
void RenderModels(const CShaderDefines &context, int cullGroup)
Definition: Renderer.cpp:975
Billboard sprite overlay, with world-space coordinates, rendered on top of all other objects...
Definition: Overlay.h:136
bool m_WaterFancyEffects
Definition: Renderer.h:142
CCamera m_CullCamera
m_CullCamera: determines the frustum for culling and shadowmap calculations
Definition: Renderer.h:433
void RenderPatches(const CShaderDefines &context, int cullGroup)
Definition: Renderer.cpp:919
void RecomputeSystemShaderDefines()
Definition: Renderer.cpp:541
void SetSceneCamera(const CCamera &viewCamera, const CCamera &cullCamera)
Set up the camera used for rendering the next scene; this includes setting OpenGL state like viewport...
Definition: Renderer.cpp:1682
CFontManager & GetFontManager()
Definition: Renderer.cpp:2118
bool m_ARBProgramShadow
Definition: Renderer.h:166
void SetViewport(const SViewPort &)
Definition: Renderer.cpp:1692
CRenderer()
Definition: Renderer.cpp:413
float v1
Definition: Renderer.h:447
bool m_Postproc
Definition: Renderer.h:159
friend class PolygonSortModelRenderer
Definition: Renderer.h:347
CShaderDefines m_SystemShaderDefines
Definition: Renderer.h:417
friend class FixedFunctionModelRenderer
Definition: Renderer.h:345
Definition: Renderer.h:85
bool m_DisplayTerrainPriorities
Enable rendering of terrain tile priority text overlay, for debugging.
Definition: Renderer.h:470
Definition: Material.h:28
const Caps & GetCapabilities() const
GetCapabilities: Return which OpenGL capabilities are available and enabled.
Definition: Renderer.h:331
Definition: Renderer.h:83
Public API for simulation system.
Definition: Simulation2.h:47
static CStr GetRenderPathName(RenderPath rp)
Definition: Renderer.cpp:826
Definition: Vector4D.h:28
CVertexBuffer: encapsulation of ARB_vertex_buffer_object, also supplying some additional functionalit...
Definition: VertexBuffer.h:55
This interface accepts renderable objects.
Definition: Scene.h:83
CCamera m_ViewCamera
m_ViewCamera: determines the eye position for rendering
Definition: Renderer.h:426
Render non-animated (but potentially moving) models using a ShaderRenderModifier. ...
Definition: InstancingModelRenderer.h:35
SkyManager * m_SkyManager
m_SkyManager: the SkyManager object used for sky textures and settings
Definition: Renderer.h:465
const CCamera & GetCullCamera() const
Definition: Renderer.h:292
CRendererInternals * m
Private data that is not needed by inline functions.
Definition: Renderer.h:407
Definition: TimeManager.h:26
bool m_WaterReflection
Definition: Renderer.h:145
float GetAspect() const
Definition: Renderer.h:197
bool m_WaterRealDepth
Definition: Renderer.h:143
float v0
Definition: Renderer.h:447
Texture manager with asynchronous loading and automatic DDS conversion/compression.
Definition: TextureManager.h:71
bool m_ForceAlphaTest
Definition: Renderer.h:154
RenderPath m_RenderPath
Definition: Renderer.h:148
void RenderTransparentModels(const CShaderDefines &context, int cullGroup, ETransparentMode transparentMode, bool disableFaceCulling)
Definition: Renderer.cpp:1010
Handle m_hCompositeAlphaMap
Definition: Renderer.h:444
void SetTerrainRenderMode(ERenderMode mode)
Definition: Renderer.h:259
size_t m_OverlayTris
Definition: Renderer.h:129
CMaterialManager & GetMaterialManager()
Definition: Renderer.cpp:2108
CLightEnv * m_LightEnv
Definition: Renderer.h:442
Textured line overlay, with world-space coordinates, rendered in the world onto the terrain...
Definition: Overlay.h:61
void DisplayFrustum()
Definition: Renderer.cpp:1641
void SetViewCamera(const CCamera &camera)
Definition: Renderer.h:289
Option
Definition: Renderer.h:75
Definition: Renderer.h:77
Definition: Renderer.h:56
Definition: path.h:77
Definition: Renderer.h:74
Definition: Renderer.h:90
float m_ShadowZBias
m_ShadowZBias: Z bias used when rendering shadows into a depth texture.
Definition: Renderer.h:480
bool GetOptionBool(enum Option opt) const
Definition: Renderer.cpp:741
friend class RenderPathVertexShader
Definition: Renderer.h:349
void RenderSubmissions(const CBoundingBoxAligned &waterScissor)
Definition: Renderer.cpp:1451
Class ModelRenderer: Abstract base class for all model renders.
Definition: ModelRenderer.h:104
Definition: Renderer.h:96
bool m_Particles
Definition: Renderer.h:152
bool m_VertexShader
Definition: Renderer.h:167
size_t m_BlendSplats
Definition: Renderer.h:131
bool m_Silhouettes
Definition: Renderer.h:156
Definition: PatchRData.h:38
Font manager: loads and caches bitmap fonts.
Definition: FontManager.h:29
void SetSimulation(CSimulation2 *simulation)
Set simulation context for rendering purposes.
Definition: Renderer.cpp:869
Definition: Camera.h:39
int m_ShadowMapSize
m_ShadowMapSize: Size of shadow map, or 0 for default.
Definition: Renderer.h:489
Definition: SColor.h:30
Definition: Renderer.h:110
Definition: Renderer.h:78
Definition: Renderer.h:137
bool m_PrettyWater
Definition: Renderer.h:170
SViewPort GetViewport()
Definition: Renderer.cpp:1698
Definition: Renderer.h:107
void UnloadAlphaMaps()
Definition: Renderer.cpp:2053
int GetWidth() const
Definition: Renderer.h:193
bool m_WaterRefraction
Definition: Renderer.h:144
Definition: Patch.h:48
struct CRenderer::@48 m_AlphaMapCoords[NumAlphaMaps]
Definition: Renderer.h:163
i64 Status
Error handling system.
Definition: status.h:171
static Status ReloadChangedFileCB(void *param, const VfsPath &path)
Definition: Renderer.cpp:2061
int m_CurrentCullGroup
Definition: Renderer.h:437
i64 Handle
`handle&#39; representing a reference to a resource (sound, texture, etc.)
Definition: handle.h:41
Definition: Renderer.h:113
void Submit(CPatch *patch)
Submit a terrain patch that is part of the scene.
Definition: Renderer.cpp:1703
const CLightEnv & GetLightEnv()
Definition: Renderer.h:284
Definition: ParticleManager.h:29
int LoadAlphaMaps()
Definition: Renderer.cpp:1909
Definition: Renderer.h:117
RenderPath GetRenderPath() const
Definition: Renderer.h:188
static void RegisterScriptFunctions(ScriptInterface &scriptInterface)
bool m_PreferGLSL
Definition: Renderer.h:153
Definition: Renderer.h:97
void EndFrame()
Definition: Renderer.cpp:1606
bool m_Shadows
Definition: Renderer.h:139
CTextureManager & GetTextureManager()
Definition: Renderer.cpp:2083
void RenderSilhouettes(const CShaderDefines &context)
Definition: Renderer.cpp:1316
Represents a mapping of name strings to value strings, for use with #if and #ifdef and similar condit...
Definition: ShaderDefines.h:133
float u1
Definition: Renderer.h:447
TerrainRenderer & GetTerrainRenderer()
Definition: Renderer.cpp:2098
void MakeShadersDirty()
Definition: Renderer.cpp:2078
Definition: Renderer.h:82
bool m_ShadowAlphaFix
Definition: Renderer.h:149
float u0
Definition: Renderer.h:447
size_t m_Particles
Definition: Renderer.h:133
Definition: Renderer.h:79
friend class HWLightingModelRenderer
Definition: Renderer.h:350
int GetHeight() const
Definition: Renderer.h:195
Struct CRendererInternals: Truly hide data that is supposed to be hidden in this structure so it won&#39;...
Definition: Renderer.cpp:253
Rectangular single-quad terrain overlay, in world space coordinates.
Definition: Overlay.h:149
ERenderMode
Definition: Renderer.h:56
friend class WaterRenderer
Definition: Renderer.h:355
Definition: Renderer.h:100
WaterManager * m_WaterManager
m_WaterManager: the WaterManager object used for water textures and settings (e.g.
Definition: Renderer.h:460
CShaderManager & GetShaderManager()
Definition: Renderer.cpp:2088
friend class SortModelRenderer
Definition: Renderer.h:348
Definition: Decal.h:50
Definition: Renderer.h:80
Definition: BoundingBoxAligned.h:35
bool Open(int width, int height)
Definition: Renderer.cpp:612
static size_t model
Definition: x86_x64.cpp:221
Scene & GetScene()
Return the scene that is currently being rendered.
Definition: Renderer.cpp:1881
WaterManager * GetWaterManager()
GetWaterManager: Return the renderer&#39;s water manager.
Definition: Renderer.h:299
CParticleManager & GetParticleManager()
Definition: Renderer.cpp:2093
ERenderMode GetModelRenderMode() const
Definition: Renderer.h:266
Definition: Renderer.h:86
ETransparentMode
Definition: Renderer.h:59
SkyManager * GetSkyManager()
GetSkyManager: Return the renderer&#39;s sky manager.
Definition: Renderer.h:306
void RenderShadowMap(const CShaderDefines &context)
Definition: Renderer.cpp:884
size_t m_TerrainTris
Definition: Renderer.h:123
Definition: PostprocManager.h:24
This interface describes a scene to the renderer.
Definition: Scene.h:52
void SubmitNonRecursive(CModel *model)
Submit a model that is part of the scene, without submitting attached models.
Definition: Renderer.cpp:1766
CShaderDefines GetSystemShaderDefines()
Definition: Renderer.h:320
ERenderMode m_ModelRenderMode
Definition: Renderer.h:415
void Reset()
Definition: Renderer.h:119
Definition: Renderer.h:91
void SetRenderPath(RenderPath rp)
Definition: Renderer.cpp:788
Definition: Renderer.h:68
Class TerrainRenderer: Render everything related to the terrain, especially patches and water...
Definition: TerrainRenderer.h:37
Definition: Singleton.h:34
float m_ClearColor[4]
Definition: Renderer.h:440
Definition: Renderer.h:89
Abstraction around a SpiderMonkey JSContext.
Definition: ScriptInterface.h:71
void SetOptionBool(enum Option opt, bool value)
Definition: Renderer.cpp:674
bool m_ShadowPCF
Definition: Renderer.h:151
Definition: MaterialManager.h:25
void RenderScene(Scene &scene)
Render the given scene immediately.
Definition: Renderer.cpp:1807
Definition: Model.h:48
void RenderReflections(const CShaderDefines &context, const CBoundingBoxAligned &scissor)
Definition: Renderer.cpp:1175
Definition: Renderer.h:56
int m_Width
Definition: Renderer.h:409
const CCamera & GetViewCamera() const
Definition: Renderer.h:287
Class CLightEnv: description of a lighting environment - contains all the necessary parameters for re...
Definition: LightEnv.h:36
Definition: Renderer.h:76
RenderPath
Definition: Renderer.h:104
bool m_FragmentShader
Definition: Renderer.h:168
Stats m_Stats
Definition: Renderer.h:454
void SetObliqueFrustumClipping(CCamera &camera, const CVector4D &clipPlane) const
Definition: Renderer.cpp:1069
bool m_SkipSubmit
m_SkipSubmit: Disable the actual submission of rendering commands to OpenGL.
Definition: Renderer.h:497
Stats & GetStats()
Definition: Renderer.h:281
void RenderTextOverlays()
Render text overlays on top of the scene.
Definition: Renderer.cpp:1668
Definition: Renderer.h:95
Definition: Overlay.h:157
void SetModelRenderMode(ERenderMode mode)
Definition: Renderer.h:264
bool m_NoVBO
Definition: Renderer.h:138
Shader manager: loads and caches shader programs.
Definition: ShaderManager.h:42
bool m_GPUSkinning
Definition: Renderer.h:155
Scene * m_CurrentScene
Definition: Renderer.h:436
size_t m_DrawCalls
Definition: Renderer.h:121
void BeginFrame()
Definition: Renderer.cpp:852
void BindTexture(int unit, unsigned int tex)
Definition: Renderer.cpp:1889
Caps m_Caps
Definition: Renderer.h:450
struct CRenderer::Options m_Options
CPostprocManager & GetPostprocManager()
Definition: Renderer.cpp:2113
Definition: Renderer.h:59
Definition: Renderer.h:88
Class WaterManager: Maintain rendering-related water settings and textures Anything that affects game...
Definition: WaterManager.h:43
Definition: Renderer.h:101
bool m_DisplayFrustum
Definition: Renderer.h:160
void RenderRefractions(const CShaderDefines &context, const CBoundingBoxAligned &scissor)
Definition: Renderer.cpp:1255
Class SkyManager: Maintain sky settings and textures, and render the sky.
Definition: SkyManager.h:30