MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / render

Method render

Engine/source/renderInstance/renderMeshMgr.cpp:95–284  ·  view source on GitHub ↗

----------------------------------------------------------------------------- render -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

93// render
94//-----------------------------------------------------------------------------
95void RenderMeshMgr::render(SceneRenderState * state)
96{
97 PROFILE_SCOPE(RenderMeshMgr_render);
98
99 // Early out if nothing to draw.
100 if(!mElementList.size())
101 return;
102
103
104 GFXDEBUGEVENT_SCOPE( RenderMeshMgr_Render, ColorI::GREEN );
105
106 // Automagically save & restore our viewport and transforms.
107 GFXTransformSaver saver;
108
109 // Restore transforms
110 MatrixSet &matrixSet = getRenderPass()->getMatrixSet();
111 matrixSet.restoreSceneViewProjection();
112
113 // init loop data
114 GFXTextureObject *lastLM = NULL;
115 GFXCubemap *lastCubemap = NULL;
116 GFXTextureObject *lastReflectTex = NULL;
117 GFXTextureObject *lastMiscTex = NULL;
118 GFXTextureObject *lastAccuTex = NULL;
119
120 SceneData sgData;
121 sgData.init( state );
122
123 U32 binSize = mElementList.size();
124
125 for( U32 j=0; j<binSize; )
126 {
127 MeshRenderInst *ri = static_cast<MeshRenderInst*>(mElementList[j].inst);
128
129 setupSGData( ri, sgData );
130 BaseMatInstance *mat = ri->matInst;
131
132 // If we have an override delegate then give it a
133 // chance to swap the material with another.
134 if ( mMatOverrideDelegate )
135 {
136 mat = mMatOverrideDelegate( mat );
137 if ( !mat )
138 {
139 j++;
140 continue;
141 }
142 }
143
144 if( !mat )
145 mat = MATMGR->getWarningMatInstance();
146
147 // Check if bin is disabled in advanced lighting.
148 // Allow forward rendering pass on custom materials.
149
150 if ( ( MATMGR->getPrePassEnabled() && mBasicOnly && !mat->isCustomMaterial() ) )
151 {
152 j++;

Callers

nothing calls this directly

Calls 15

getWarningMatInstanceMethod · 0.80
getPrePassEnabledMethod · 0.80
isCustomMaterialMethod · 0.80
usesHardwareSkinningMethod · 0.80
isInstancedMethod · 0.80
sizeMethod · 0.45
initMethod · 0.45
setupPassMethod · 0.45
setTransformsMethod · 0.45
setNodeTransformsMethod · 0.45
setSceneInfoMethod · 0.45
stepInstanceMethod · 0.45

Tested by

no test coverage detected