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