Pyrogenesis
trunk
|
#include <Renderer.h>
Classes | |
struct | Caps |
struct | Options |
struct | Stats |
Public Types | |
enum | { NumAlphaMaps =14 } |
enum | Option { OPT_NOVBO, OPT_SHADOWS, OPT_WATERUGLY, OPT_WATERFANCYEFFECTS, OPT_WATERREALDEPTH, OPT_WATERREFLECTION, OPT_WATERREFRACTION, OPT_SHADOWSONWATER, OPT_SHADOWPCF, OPT_PARTICLES, OPT_PREFERGLSL, OPT_SILHOUETTES, OPT_SHOWSKY, OPT_SMOOTHLOS, OPT_POSTPROC, OPT_DISPLAYFRUSTUM } |
enum | CullGroup { CULL_DEFAULT, CULL_SHADOWS, CULL_REFLECTIONS, CULL_REFRACTIONS, CULL_SILHOUETTE_OCCLUDER, CULL_SILHOUETTE_CASTER, CULL_MAX } |
enum | RenderPath { RP_DEFAULT, RP_FIXED, RP_SHADER } |
Public Member Functions | |
CRenderer () | |
~CRenderer () | |
bool | Open (int width, int height) |
void | Resize (int width, int height) |
void | SetOptionBool (enum Option opt, bool value) |
bool | GetOptionBool (enum Option opt) const |
void | SetRenderPath (RenderPath rp) |
RenderPath | GetRenderPath () const |
int | GetWidth () const |
int | GetHeight () const |
float | GetAspect () const |
void | BeginFrame () |
void | EndFrame () |
void | SetSimulation (CSimulation2 *simulation) |
Set simulation context for rendering purposes. More... | |
void | SetClearColor (SColor4ub color) |
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 | SetViewport (const SViewPort &) |
SViewPort | GetViewport () |
void | RenderScene (Scene &scene) |
Render the given scene immediately. More... | |
Scene & | GetScene () |
Return the scene that is currently being rendered. More... | |
void | RenderTextOverlays () |
Render text overlays on top of the scene. More... | |
void | SetLightEnv (CLightEnv *lightenv) |
void | SetTerrainRenderMode (ERenderMode mode) |
ERenderMode | GetTerrainRenderMode () const |
void | SetModelRenderMode (ERenderMode mode) |
ERenderMode | GetModelRenderMode () const |
void | SetDisplayTerrainPriorities (bool enabled) |
void | BindTexture (int unit, unsigned int tex) |
int | LoadAlphaMaps () |
void | UnloadAlphaMaps () |
Stats & | GetStats () |
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... | |
CTextureManager & | GetTextureManager () |
CShaderManager & | GetShaderManager () |
CParticleManager & | GetParticleManager () |
TerrainRenderer & | GetTerrainRenderer () |
CMaterialManager & | GetMaterialManager () |
CFontManager & | GetFontManager () |
CShaderDefines | GetSystemShaderDefines () |
CTimeManager & | GetTimeManager () |
CPostprocManager & | GetPostprocManager () |
const Caps & | GetCapabilities () const |
GetCapabilities: Return which OpenGL capabilities are available and enabled. More... | |
void | ResetState () |
Resets the render state to default, that was before a game started. More... | |
Public Member Functions inherited from Singleton< CRenderer > | |
Singleton () | |
~Singleton () | |
Static Public Member Functions | |
static CStr | GetRenderPathName (RenderPath rp) |
static RenderPath | GetRenderPathByName (const CStr &name) |
static void | RegisterScriptFunctions (ScriptInterface &scriptInterface) |
Static Public Member Functions inherited from Singleton< CRenderer > | |
static CRenderer & | GetSingleton () |
static CRenderer * | GetSingletonPtr () |
static bool | IsInitialised () |
Public Attributes | |
struct CRenderer::Options | m_Options |
float | m_ShadowZBias |
m_ShadowZBias: Z bias used when rendering shadows into a depth texture. More... | |
int | m_ShadowMapSize |
m_ShadowMapSize: Size of shadow map, or 0 for default. More... | |
bool | m_SkipSubmit |
m_SkipSubmit: Disable the actual submission of rendering commands to OpenGL. More... | |
float | u0 |
float | u1 |
float | v0 |
float | v1 |
Protected Member Functions | |
void | Submit (CPatch *patch) |
Submit a terrain patch that is part of the scene. More... | |
void | Submit (SOverlayLine *overlay) |
Submit a line-based overlay. More... | |
void | Submit (SOverlayTexturedLine *overlay) |
Submit a textured line overlay. More... | |
void | Submit (SOverlaySprite *overlay) |
Submit a sprite overlay. More... | |
void | Submit (SOverlayQuad *overlay) |
Submit a textured quad overlay. More... | |
void | Submit (CModelDecal *decal) |
Submit a terrain decal. More... | |
void | Submit (CParticleEmitter *emitter) |
Submit a particle emitter. More... | |
void | Submit (SOverlaySphere *overlay) |
Submit a sphere overlay. More... | |
void | SubmitNonRecursive (CModel *model) |
Submit a model that is part of the scene, without submitting attached models. More... | |
void | RenderSubmissions (const CBoundingBoxAligned &waterScissor) |
void | RenderPatches (const CShaderDefines &context, int cullGroup) |
void | RenderModels (const CShaderDefines &context, int cullGroup) |
void | RenderTransparentModels (const CShaderDefines &context, int cullGroup, ETransparentMode transparentMode, bool disableFaceCulling) |
void | RenderSilhouettes (const CShaderDefines &context) |
void | RenderParticles (int cullGroup) |
void | RenderShadowMap (const CShaderDefines &context) |
void | RenderReflections (const CShaderDefines &context, const CBoundingBoxAligned &scissor) |
void | RenderRefractions (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 |
void | ReloadShaders () |
void | RecomputeSystemShaderDefines () |
void | EnumCaps () |
Static Protected Member Functions | |
static Status | ReloadChangedFileCB (void *param, const VfsPath &path) |
Protected Attributes | |
CRendererInternals * | m |
Private data that is not needed by inline functions. More... | |
int | m_Width |
int | m_Height |
ERenderMode | m_TerrainRenderMode |
ERenderMode | m_ModelRenderMode |
CShaderDefines | m_SystemShaderDefines |
SViewPort | m_Viewport |
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 |
float | m_ClearColor [4] |
CLightEnv * | m_LightEnv |
Handle | m_hCompositeAlphaMap |
struct { | |
float u0 | |
float u1 | |
float v0 | |
float v1 | |
} | m_AlphaMapCoords [NumAlphaMaps] |
Caps | m_Caps |
Stats | m_Stats |
WaterManager * | m_WaterManager |
m_WaterManager: the WaterManager object used for water textures and settings (e.g. More... | |
SkyManager * | m_SkyManager |
m_SkyManager: the SkyManager object used for sky textures and settings More... | |
bool | m_DisplayTerrainPriorities |
Enable rendering of terrain tile priority text overlay, for debugging. More... | |
Friends | |
struct | CRendererInternals |
class | CVertexBuffer |
class | CPatchRData |
class | CDecalRData |
class | FixedFunctionModelRenderer |
class | ModelRenderer |
class | PolygonSortModelRenderer |
class | SortModelRenderer |
class | RenderPathVertexShader |
class | HWLightingModelRenderer |
class | ShaderModelVertexRenderer |
class | InstancingModelRenderer |
class | ShaderInstancingModelRenderer |
class | TerrainRenderer |
class | WaterRenderer |
Additional Inherited Members | |
Private Member Functions inherited from SceneCollector | |
virtual | ~SceneCollector () |
virtual void | SubmitRecursive (CModelAbstract *model) |
Submit a model that is part of the scene, including attached sub-models. More... | |
enum CRenderer::CullGroup |
enum CRenderer::Option |
CRenderer::CRenderer | ( | ) |
CRenderer::~CRenderer | ( | ) |
void CRenderer::BeginFrame | ( | ) |
void CRenderer::BindTexture | ( | int | unit, |
unsigned int | tex | ||
) |
|
protected |
|
protected |
|
protected |
void CRenderer::EndFrame | ( | ) |
|
protected |
|
inline |
|
inline |
GetCapabilities: Return which OpenGL capabilities are available and enabled.
|
inline |
CFontManager & CRenderer::GetFontManager | ( | ) |
|
inline |
|
inline |
CMaterialManager & CRenderer::GetMaterialManager | ( | ) |
|
inline |
bool CRenderer::GetOptionBool | ( | enum Option | opt | ) | const |
CParticleManager & CRenderer::GetParticleManager | ( | ) |
CPostprocManager & CRenderer::GetPostprocManager | ( | ) |
|
inline |
|
static |
|
static |
Scene & CRenderer::GetScene | ( | ) |
Return the scene that is currently being rendered.
Only valid when the renderer is in a RenderScene call.
CShaderManager & CRenderer::GetShaderManager | ( | ) |
|
inline |
GetSkyManager: Return the renderer's sky manager.
|
inline |
|
inline |
TerrainRenderer & CRenderer::GetTerrainRenderer | ( | ) |
|
inline |
CTextureManager & CRenderer::GetTextureManager | ( | ) |
CTimeManager & CRenderer::GetTimeManager | ( | ) |
|
inline |
SViewPort CRenderer::GetViewport | ( | ) |
|
inline |
GetWaterManager: Return the renderer's water manager.
|
inline |
int CRenderer::LoadAlphaMaps | ( | ) |
void CRenderer::MakeShadersDirty | ( | ) |
bool CRenderer::Open | ( | int | width, |
int | height | ||
) |
|
protected |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
void CRenderer::RenderScene | ( | Scene & | scene | ) |
Render the given scene immediately.
scene | a Scene object describing what should be rendered. |
|
protected |
|
protected |
|
protected |
void CRenderer::RenderTextOverlays | ( | ) |
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 CRenderer::ResetState | ( | ) |
Resets the render state to default, that was before a game started.
void CRenderer::Resize | ( | int | width, |
int | height | ||
) |
void CRenderer::SetClearColor | ( | SColor4ub | color | ) |
|
inline |
|
inline |
|
inline |
|
protected |
void CRenderer::SetOptionBool | ( | enum Option | opt, |
bool | value | ||
) |
void CRenderer::SetRenderPath | ( | RenderPath | rp | ) |
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 CRenderer::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 |
void CRenderer::SetViewport | ( | const SViewPort & | vp | ) |
|
protectedvirtual |
Submit a terrain patch that is part of the scene.
Implements SceneCollector.
|
protectedvirtual |
Submit a line-based overlay.
Implements SceneCollector.
|
protectedvirtual |
Submit a textured line overlay.
Implements SceneCollector.
|
protectedvirtual |
Submit a sprite overlay.
Implements SceneCollector.
|
protectedvirtual |
Submit a textured quad overlay.
Implements SceneCollector.
|
protectedvirtual |
Submit a terrain decal.
Implements SceneCollector.
|
protectedvirtual |
Submit a particle emitter.
Implements SceneCollector.
|
protectedvirtual |
Submit a sphere overlay.
Implements SceneCollector.
|
protectedvirtual |
Submit a model that is part of the scene, without submitting attached models.
Implements SceneCollector.
void CRenderer::UnloadAlphaMaps | ( | ) |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |
Private data that is not needed by inline functions.
struct { ... } CRenderer::m_AlphaMapCoords[NumAlphaMaps] |
|
protected |
|
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 |
struct CRenderer::Options CRenderer::m_Options |
int CRenderer::m_ShadowMapSize |
m_ShadowMapSize: Size of shadow map, or 0 for default.
Typically slow but useful for high-quality rendering. Changes don't take effect until the shadow map is regenerated.
Can be accessed via JS as renderer.shadowMapSize
float CRenderer::m_ShadowZBias |
bool CRenderer::m_SkipSubmit |
m_SkipSubmit: Disable the actual submission of rendering commands to OpenGL.
All state setup is still performed as usual.
Can be accessed via JS as renderer.skipSubmit
|
protected |
m_SkyManager: the SkyManager object used for sky textures and settings
|
protected |
|
protected |
|
protected |
|
protected |
m_ViewCamera: determines the eye position for rendering
|
protected |
|
protected |
m_WaterManager: the WaterManager object used for water textures and settings (e.g.
water color, water height)
|
protected |
float CRenderer::u0 |
float CRenderer::u1 |
float CRenderer::v0 |
float CRenderer::v1 |