Pyrogenesis trunk
|
#include <SceneRenderer.h>
Classes | |
class | Internals |
Struct CSceneRendererInternals: Truly hide data that is supposed to be hidden in this structure so it won't even appear in header files. More... | |
Public Types | |
enum | CullGroup { CULL_DEFAULT , CULL_SHADOWS_CASCADE_0 , CULL_SHADOWS_CASCADE_1 , CULL_SHADOWS_CASCADE_2 , CULL_SHADOWS_CASCADE_3 , CULL_REFLECTIONS , CULL_REFRACTIONS , CULL_SILHOUETTE_OCCLUDER , CULL_SILHOUETTE_CASTER , CULL_MAX } |
Public Member Functions | |
CSceneRenderer (Renderer::Backend::IDevice *device) | |
~CSceneRenderer () | |
void | Initialize () |
void | Resize (int width, int height) |
void | BeginFrame () |
void | EndFrame () |
void | SetSimulation (CSimulation2 *simulation) |
Set simulation context for rendering purposes. More... | |
void | MakeShadersDirty () |
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, projection and modelview matrices. More... | |
void | PrepareScene (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, Scene &scene) |
Enumerate and submit all objects of the given scene which should be rendered. More... | |
void | RenderScene (Renderer::Backend::IDeviceCommandContext *deviceCommandContext) |
Render submitted objects of the previously given scene. More... | |
void | RenderSceneOverlays (Renderer::Backend::IDeviceCommandContext *deviceCommandContext) |
Render overlays of the previously given scene. More... | |
Scene & | GetScene () |
Return the scene that is currently being rendered. More... | |
void | RenderTextOverlays (CCanvas2D &canvas) |
Render text overlays on top of the scene. More... | |
void | SetLightEnv (CLightEnv *lightenv) |
void | SetTerrainRenderMode (ERenderMode mode) |
ERenderMode | GetTerrainRenderMode () const |
void | SetWaterRenderMode (ERenderMode mode) |
ERenderMode | GetWaterRenderMode () const |
void | SetModelRenderMode (ERenderMode mode) |
ERenderMode | GetModelRenderMode () const |
ERenderMode | GetOverlayRenderMode () const |
void | SetOverlayRenderMode (ERenderMode mode) |
void | SetDisplayTerrainPriorities (bool enabled) |
const CLightEnv & | GetLightEnv () |
const CCamera & | GetViewCamera () const |
void | SetViewCamera (const CCamera &camera) |
const CCamera & | GetCullCamera () const |
WaterManager & | GetWaterManager () |
GetWaterManager: Return the renderer's water manager. More... | |
SkyManager & | GetSkyManager () |
GetSkyManager: Return the renderer's sky manager. More... | |
CParticleManager & | GetParticleManager () |
TerrainRenderer & | GetTerrainRenderer () |
CMaterialManager & | GetMaterialManager () |
ShadowMap & | GetShadowMap () |
void | ResetState () |
Resets the render state to default, that was before a game started. More... | |
void | ReloadShaders (Renderer::Backend::IDevice *device) |
Public Member Functions inherited from SceneCollector | |
virtual | ~SceneCollector () |
virtual void | Submit (CPatch *patch)=0 |
Submit a terrain patch that is part of the scene. More... | |
virtual void | Submit (SOverlayLine *overlay)=0 |
Submit a line-based overlay. More... | |
virtual void | Submit (SOverlayTexturedLine *overlay)=0 |
Submit a textured line overlay. More... | |
virtual void | Submit (SOverlaySprite *overlay)=0 |
Submit a sprite overlay. More... | |
virtual void | Submit (SOverlayQuad *overlay)=0 |
Submit a textured quad overlay. More... | |
virtual void | Submit (SOverlaySphere *overlay)=0 |
Submit a sphere overlay. More... | |
virtual void | Submit (CModelDecal *decal)=0 |
Submit a terrain decal. More... | |
virtual void | Submit (CParticleEmitter *emitter)=0 |
Submit a particle emitter. More... | |
virtual void | SubmitNonRecursive (CModel *model)=0 |
Submit a model that is part of the scene, without submitting attached models. More... | |
virtual void | SubmitRecursive (CModelAbstract *model) |
Submit a model that is part of the scene, including attached sub-models. More... | |
Protected Member Functions | |
void | Submit (CPatch *patch) override |
Submit a terrain patch that is part of the scene. More... | |
void | Submit (SOverlayLine *overlay) override |
Submit a line-based overlay. More... | |
void | Submit (SOverlayTexturedLine *overlay) override |
Submit a textured line overlay. More... | |
void | Submit (SOverlaySprite *overlay) override |
Submit a sprite overlay. More... | |
void | Submit (SOverlayQuad *overlay) override |
Submit a textured quad overlay. More... | |
void | Submit (CModelDecal *decal) override |
Submit a terrain decal. More... | |
void | Submit (CParticleEmitter *emitter) override |
Submit a particle emitter. More... | |
void | Submit (SOverlaySphere *overlay) override |
Submit a sphere overlay. More... | |
void | SubmitNonRecursive (CModel *model) override |
Submit a model that is part of the scene, without submitting attached models. More... | |
void | PrepareSubmissions (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, const CBoundingBoxAligned &waterScissor) |
Update and upload all needed data for submitted objects. More... | |
void | RenderSubmissions (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, const CBoundingBoxAligned &waterScissor) |
void | RenderPatches (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, const CShaderDefines &context, int cullGroup) |
void | RenderModels (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, const CShaderDefines &context, int cullGroup) |
void | RenderTransparentModels (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, const CShaderDefines &context, int cullGroup, ETransparentMode transparentMode) |
void | RenderSilhouettes (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, const CShaderDefines &context) |
void | RenderParticles (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, int cullGroup) |
void | RenderShadowMap (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, const CShaderDefines &context) |
void | RenderReflections (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, const CShaderDefines &context, const CBoundingBoxAligned &scissor) |
void | RenderRefractions (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, const CShaderDefines &context, const CBoundingBoxAligned &scissor) |
void | ComputeReflectionCamera (CCamera &camera, const CBoundingBoxAligned &scissor) const |
void | ComputeRefractionCamera (CCamera &camera, const CBoundingBoxAligned &scissor) const |
void | DisplayFrustum () |
void | SetObliqueFrustumClipping (CCamera &camera, const CVector4D &clipPlane) const |
Protected Attributes | |
std::unique_ptr< Internals > | m |
ERenderMode | m_TerrainRenderMode |
ERenderMode | m_WaterRenderMode |
ERenderMode | m_ModelRenderMode |
ERenderMode | m_OverlayRenderMode |
CCamera | m_ViewCamera |
m_ViewCamera: determines the eye position for rendering More... | |
CCamera | m_CullCamera |
m_CullCamera: determines the frustum for culling and shadowmap calculations More... | |
Scene * | m_CurrentScene |
int | m_CurrentCullGroup |
CBoundingBoxAligned | m_WaterScissor |
CLightEnv * | m_LightEnv |
bool | m_DisplayTerrainPriorities |
Enable rendering of terrain tile priority text overlay, for debugging. More... | |
CSceneRenderer::CSceneRenderer | ( | Renderer::Backend::IDevice * | device | ) |
CSceneRenderer::~CSceneRenderer | ( | ) |
void CSceneRenderer::BeginFrame | ( | ) |
|
protected |
|
protected |
|
protected |
void CSceneRenderer::EndFrame | ( | ) |
|
inline |
|
inline |
CMaterialManager & CSceneRenderer::GetMaterialManager | ( | ) |
|
inline |
|
inline |
CParticleManager & CSceneRenderer::GetParticleManager | ( | ) |
Scene & CSceneRenderer::GetScene | ( | ) |
Return the scene that is currently being rendered.
Only valid when the renderer is in a RenderScene call.
ShadowMap & CSceneRenderer::GetShadowMap | ( | ) |
SkyManager & CSceneRenderer::GetSkyManager | ( | ) |
GetSkyManager: Return the renderer's sky manager.
TerrainRenderer & CSceneRenderer::GetTerrainRenderer | ( | ) |
|
inline |
|
inline |
WaterManager & CSceneRenderer::GetWaterManager | ( | ) |
GetWaterManager: Return the renderer's water manager.
|
inline |
void CSceneRenderer::Initialize | ( | ) |
void CSceneRenderer::MakeShadersDirty | ( | ) |
void CSceneRenderer::PrepareScene | ( | Renderer::Backend::IDeviceCommandContext * | deviceCommandContext, |
Scene & | scene | ||
) |
Enumerate and submit all objects of the given scene which should be rendered.
Must be called before RenderScene.
|
protected |
Update and upload all needed data for submitted objects.
void CSceneRenderer::ReloadShaders | ( | Renderer::Backend::IDevice * | device | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
void CSceneRenderer::RenderScene | ( | Renderer::Backend::IDeviceCommandContext * | deviceCommandContext | ) |
Render submitted objects of the previously given scene.
void CSceneRenderer::RenderSceneOverlays | ( | Renderer::Backend::IDeviceCommandContext * | deviceCommandContext | ) |
Render overlays of the previously given scene.
Must be called after RenderScene.
|
protected |
|
protected |
|
protected |
void CSceneRenderer::RenderTextOverlays | ( | CCanvas2D & | canvas | ) |
Render text overlays on top of the scene.
Assumes the caller has set up the GL environment for orthographic rendering with texturing and blending.
|
protected |
void CSceneRenderer::ResetState | ( | ) |
Resets the render state to default, that was before a game started.
void CSceneRenderer::Resize | ( | int | width, |
int | height | ||
) |
|
inline |
|
inline |
|
inline |
|
protected |
|
inline |
Set up the camera used for rendering the next scene; this includes setting OpenGL state like viewport, projection and modelview matrices.
viewCamera | this camera determines the eye position for rendering |
cullCamera | this camera determines the frustum for culling in the renderer and for shadow calculations |
void CSceneRenderer::SetSimulation | ( | CSimulation2 * | simulation | ) |
Set simulation context for rendering purposes.
Must be called at least once when the game has started and before frames are rendered.
|
inline |
|
inline |
|
inline |
|
overrideprotectedvirtual |
Submit a terrain decal.
Implements SceneCollector.
|
overrideprotectedvirtual |
Submit a particle emitter.
Implements SceneCollector.
|
overrideprotectedvirtual |
Submit a terrain patch that is part of the scene.
Implements SceneCollector.
|
overrideprotectedvirtual |
Submit a line-based overlay.
Implements SceneCollector.
|
overrideprotectedvirtual |
Submit a textured quad overlay.
Implements SceneCollector.
|
overrideprotectedvirtual |
Submit a sphere overlay.
Implements SceneCollector.
|
overrideprotectedvirtual |
Submit a sprite overlay.
Implements SceneCollector.
|
overrideprotectedvirtual |
Submit a textured line overlay.
Implements SceneCollector.
|
overrideprotectedvirtual |
Submit a model that is part of the scene, without submitting attached models.
Implements SceneCollector.
|
protected |
|
protected |
m_CullCamera: determines the frustum for culling and shadowmap calculations
|
protected |
|
protected |
|
protected |
Enable rendering of terrain tile priority text overlay, for debugging.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
m_ViewCamera: determines the eye position for rendering
|
protected |
|
protected |