Pyrogenesis
trunk
|
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 (int cullGroup, 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 cullGroup, int flags) |
Render: Render submitted models, using the given RenderModifier to setup the fragment stage. More... | |
Public Member Functions inherited from ModelRenderer | |
ModelRenderer () | |
virtual | ~ModelRenderer () |
Private Attributes | |
ShaderModelRendererInternals * | m |
Friends | |
struct | ShaderModelRendererInternals |
Additional Inherited Members | |
Static Public Member Functions inherited from ModelRenderer | |
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.
ShaderModelRenderer::ShaderModelRenderer | ( | ModelVertexRendererPtr | vertexrender | ) |
|
virtual |
|
virtual |
EndFrame: Remove all models from the list of submitted models.
Implements ModelRenderer.
|
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.
|
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.
|
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.
|
friend |
|
private |