Pyrogenesis
13997
|
Implementation of ModelRenderer that loads the appropriate shaders for rendering each model, and that batches by shader (and by mesh and texture). More...
#include <ModelRenderer.h>
Public Member Functions | |
ShaderModelRenderer (ModelVertexRendererPtr vertexrender) | |
virtual | ~ShaderModelRenderer () |
virtual void | Submit (CModel *model) |
Submit: Submit a model for rendering this frame. More... | |
virtual void | PrepareModels () |
PrepareModels: Calculate renderer data for all previously submitted models. More... | |
virtual void | EndFrame () |
EndFrame: Remove all models from the list of submitted models. More... | |
virtual void | Render (const RenderModifierPtr &modifier, const CShaderDefines &context, int flags) |
Render: Render submitted models, using the given RenderModifier to setup the fragment stage. More... | |
virtual void | Filter (CModelFilter &filter, int passed, int flags) |
Filter: Filter submitted models, setting the passed flags on any models that pass the filter, and clearing them from models that fail. More... | |
![]() | |
ModelRenderer () | |
virtual | ~ModelRenderer () |
Private Attributes | |
ShaderModelRendererInternals * | m |
Friends | |
struct | ShaderModelRendererInternals |
Additional Inherited Members | |
![]() | |
static void | Init () |
Initialise global settings. More... | |
static void | CopyPositionAndNormals (const CModelDefPtr &mdef, const VertexArrayIterator< CVector3D > &Position, const VertexArrayIterator< CVector3D > &Normal) |
CopyPositionAndNormals: Copy unanimated object-space vertices and normals into the given vertex array. More... | |
static void | BuildPositionAndNormals (CModel *model, const VertexArrayIterator< CVector3D > &Position, const VertexArrayIterator< CVector3D > &Normal) |
BuildPositionAndNormals: Build animated vertices and normals, transformed into world space. More... | |
static void | BuildColor4ub (CModel *model, const VertexArrayIterator< CVector3D > &Normal, const VertexArrayIterator< SColor4ub > &Color) |
BuildColor4ub: Build lighting colors for the given model, based on previously calculated world space normals. More... | |
static void | BuildUV (const CModelDefPtr &mdef, const VertexArrayIterator< float[2]> &UV, int UVset) |
BuildUV: Copy UV coordinates into the given vertex array. More... | |
static void | BuildIndices (const CModelDefPtr &mdef, const VertexArrayIterator< u16 > &Indices) |
BuildIndices: Create the indices array for the given CModelDef. More... | |
static void | GenTangents (const CModelDefPtr &mdef, std::vector< float > &newVertices, bool gpuSkinning) |
GenTangents: Generate tangents for the given CModelDef. More... | |
Implementation of ModelRenderer that loads the appropriate shaders for rendering each model, and that batches by shader (and by mesh and texture).
Note that the term "Shader" is somewhat misleading, as this handled fixed-function rendering using the same API as real GLSL/ARB shaders.
Definition at line 278 of file ModelRenderer.h.
ShaderModelRenderer::ShaderModelRenderer | ( | ModelVertexRendererPtr | vertexrender | ) |
Definition at line 223 of file ModelRenderer.cpp.
|
virtual |
Definition at line 229 of file ModelRenderer.cpp.
|
virtual |
EndFrame: Remove all models from the list of submitted models.
Implements ModelRenderer.
Definition at line 270 of file ModelRenderer.cpp.
|
virtual |
Filter: Filter submitted models, setting the passed flags on any models that pass the filter, and clearing them from models that fail.
filter | Filter to select a subset of models. |
passed | Flags to be set/cleared. |
flags | If non-zero, only models that contain flags have the filter test applied. |
Implements ModelRenderer.
Definition at line 766 of file ModelRenderer.cpp.
|
virtual |
PrepareModels: Calculate renderer data for all previously submitted models.
Must be called before any rendering calls and after all models for this frame have been submitted.
Implements ModelRenderer.
Definition at line 254 of file ModelRenderer.cpp.
|
virtual |
Render: Render submitted models, using the given RenderModifier to setup the fragment stage.
preconditions : PrepareModels must be called after all models have been submitted and before calling Render.
modifier | The RenderModifier that specifies the fragment stage. |
flags | If flags is 0, all submitted models are rendered. If flags is non-zero, only models that contain flags in their CModel::GetFlags() are rendered. |
Implements ModelRenderer.
Definition at line 361 of file ModelRenderer.cpp.
|
virtual |
Submit: Submit a model for rendering this frame.
preconditions : The model must not have been submitted to any ModelRenderer in this frame. Submit may only be called after EndFrame and before PrepareModels.
model | The model that will be added to the list of models submitted this frame. |
Implements ModelRenderer.
Definition at line 235 of file ModelRenderer.cpp.
|
friend |
Definition at line 280 of file ModelRenderer.h.
|
private |
Definition at line 294 of file ModelRenderer.h.