Pyrogenesis
13997
|
Class TerrainRenderer: Render everything related to the terrain, especially patches and water. More...
#include <TerrainRenderer.h>
Public Member Functions | |
TerrainRenderer () | |
~TerrainRenderer () | |
void | SetSimulation (CSimulation2 *simulation) |
Set the simulation context for this frame. More... | |
void | Submit (CPatch *patch) |
Submit: Add a patch for rendering in this frame. More... | |
void | Submit (CModelDecal *decal) |
Submit: Add a terrain decal for rendering in this frame. More... | |
void | PrepareForRendering () |
PrepareForRendering: Prepare internal data structures like vertex buffers for rendering. More... | |
void | EndFrame () |
EndFrame: Remove all patches from the list of submitted patches. More... | |
bool | CullPatches (const CFrustum *frustum) |
CullPatches: Culls patches and decals against a frustum, and stores the results in a special filtered list that is used when calling render functions with filtered true. More... | |
void | RenderTerrain (bool filtered=false) |
RenderTerrain: Render textured terrain (including blends between different terrain types). More... | |
void | RenderTerrainShader (const CShaderDefines &context, ShadowMap *shadow, bool filtered=false) |
Render textured terrain, as with RenderTerrain, but using shaders instead of multitexturing. More... | |
void | RenderPatches (bool filtered=false) |
RenderPatches: Render all patches un-textured as polygons. More... | |
void | RenderOutlines (bool filtered=false) |
RenderOutlines: Render the outline of patches as lines. More... | |
void | RenderWater (const CShaderDefines &context, ShadowMap *shadow) |
RenderWater: Render water for all patches that have been submitted this frame. More... | |
CBoundingBoxAligned | ScissorWater (const CMatrix3D &viewproj) |
Calculate a scissor rectangle for the visible water patches. More... | |
void | RenderPriorities () |
Render priority text for all submitted patches, for debugging. More... | |
void | RenderTerrainOverlayTexture (CMatrix3D &textureMatrix) |
Render texture unit 0 over the terrain mesh, with UV coords calculated by the given texture matrix. More... | |
Private Member Functions | |
bool | RenderFancyWater (const CShaderDefines &context, ShadowMap *shadow) |
RenderFancyWater: internal rendering method for fancy water. More... | |
void | RenderSimpleWater () |
RenderSimpleWater: internal rendering method for water. More... | |
Static Private Member Functions | |
static void | PrepareShader (const CShaderProgramPtr &shader, ShadowMap *shadow) |
Set up all the uniforms for a shader pass. More... | |
Private Attributes | |
TerrainRendererInternals * | m |
Friends | |
class | CPatchRData |
class | CDecalRData |
Class TerrainRenderer: Render everything related to the terrain, especially patches and water.
Definition at line 37 of file TerrainRenderer.h.
TerrainRenderer::TerrainRenderer | ( | ) |
Definition at line 100 of file TerrainRenderer.cpp.
TerrainRenderer::~TerrainRenderer | ( | ) |
Definition at line 106 of file TerrainRenderer.cpp.
bool TerrainRenderer::CullPatches | ( | const CFrustum * | frustum | ) |
CullPatches: Culls patches and decals against a frustum, and stores the results in a special filtered list that is used when calling render functions with filtered
true.
Definition at line 176 of file TerrainRenderer.cpp.
void TerrainRenderer::EndFrame | ( | ) |
EndFrame: Remove all patches from the list of submitted patches.
Definition at line 163 of file TerrainRenderer.cpp.
void TerrainRenderer::PrepareForRendering | ( | ) |
PrepareForRendering: Prepare internal data structures like vertex buffers for rendering.
All patches must have been submitted before the call to PrepareForRendering. PrepareForRendering must be called before any rendering calls.
Definition at line 154 of file TerrainRenderer.cpp.
|
staticprivate |
Set up all the uniforms for a shader pass.
Definition at line 469 of file TerrainRenderer.cpp.
|
private |
RenderFancyWater: internal rendering method for fancy water.
Returns false if unable to render with fancy water.
Definition at line 646 of file TerrainRenderer.cpp.
void TerrainRenderer::RenderOutlines | ( | bool | filtered = false | ) |
RenderOutlines: Render the outline of patches as lines.
preconditions : PrepareForRendering must have been called this frame before calling RenderOutlines.
filtered | If true then only render objects that passed CullPatches. |
Definition at line 574 of file TerrainRenderer.cpp.
void TerrainRenderer::RenderPatches | ( | bool | filtered = false | ) |
RenderPatches: Render all patches un-textured as polygons.
preconditions : PrepareForRendering must have been called this frame before calling RenderPatches.
filtered | If true then only render objects that passed CullPatches. |
Definition at line 549 of file TerrainRenderer.cpp.
void TerrainRenderer::RenderPriorities | ( | ) |
Render priority text for all submitted patches, for debugging.
Definition at line 993 of file TerrainRenderer.cpp.
|
private |
RenderSimpleWater: internal rendering method for water.
Definition at line 877 of file TerrainRenderer.cpp.
void TerrainRenderer::RenderTerrain | ( | bool | filtered = false | ) |
RenderTerrain: Render textured terrain (including blends between different terrain types).
preconditions : PrepareForRendering must have been called this frame before calling RenderTerrain.
filtered | If true then only render objects that passed CullPatches. |
Definition at line 197 of file TerrainRenderer.cpp.
void TerrainRenderer::RenderTerrainOverlayTexture | ( | CMatrix3D & | textureMatrix | ) |
Render texture unit 0 over the terrain mesh, with UV coords calculated by the given texture matrix.
Intended for use by TerrainTextureOverlay.
Definition at line 400 of file TerrainRenderer.cpp.
void TerrainRenderer::RenderTerrainShader | ( | const CShaderDefines & | context, |
ShadowMap * | shadow, | ||
bool | filtered = false |
||
) |
Render textured terrain, as with RenderTerrain, but using shaders instead of multitexturing.
shadow | A prepared shadow map, in case rendering with shadows is enabled. |
filtered | If true then only render objects that passed CullPatches. |
Definition at line 497 of file TerrainRenderer.cpp.
void TerrainRenderer::RenderWater | ( | const CShaderDefines & | context, |
ShadowMap * | shadow | ||
) |
RenderWater: Render water for all patches that have been submitted this frame.
preconditions : PrepareForRendering must have been called this frame before calling RenderWater.
Definition at line 983 of file TerrainRenderer.cpp.
CBoundingBoxAligned TerrainRenderer::ScissorWater | ( | const CMatrix3D & | viewproj | ) |
Calculate a scissor rectangle for the visible water patches.
Definition at line 595 of file TerrainRenderer.cpp.
void TerrainRenderer::SetSimulation | ( | CSimulation2 * | simulation | ) |
Set the simulation context for this frame.
Call at start of frame, before any other Submits.
Definition at line 111 of file TerrainRenderer.cpp.
void TerrainRenderer::Submit | ( | CPatch * | patch | ) |
Submit: Add a patch for rendering in this frame.
preconditions : PrepareForRendering must not have been called for this frame yet. The patch must not have been submitted in this frame yet (i.e. you can only submit a frame once).
patch | the patch |
Definition at line 118 of file TerrainRenderer.cpp.
void TerrainRenderer::Submit | ( | CModelDecal * | decal | ) |
Submit: Add a terrain decal for rendering in this frame.
Definition at line 136 of file TerrainRenderer.cpp.
|
friend |
Definition at line 40 of file TerrainRenderer.h.
|
friend |
Definition at line 39 of file TerrainRenderer.h.
|
private |
Definition at line 158 of file TerrainRenderer.h.