----------------------------------------------------------------------------- render -----------------------------------------------------------------------------
| 93 | // render |
| 94 | //----------------------------------------------------------------------------- |
| 95 | void 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++; |
nothing calls this directly
no test coverage detected