| 250 | } |
| 251 | |
| 252 | void ShadowRenderPassManager::addInst( RenderInst *inst ) |
| 253 | { |
| 254 | PROFILE_SCOPE(ShadowRenderPassManager_addInst); |
| 255 | |
| 256 | if ( inst->type == RIT_Mesh ) |
| 257 | { |
| 258 | MeshRenderInst *meshRI = static_cast<MeshRenderInst*>( inst ); |
| 259 | if ( !meshRI->matInst ) |
| 260 | return; |
| 261 | |
| 262 | const BaseMaterialDefinition *mat = meshRI->matInst->getMaterial(); |
| 263 | if ( !mat->castsShadows() || (mat->isTranslucent() && !mat->isAlphatest())) |
| 264 | { |
| 265 | // Do not add this instance, return here and avoid the default behavior |
| 266 | // of calling up to Parent::addInst() |
| 267 | return; |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | Parent::addInst(inst); |
| 272 | } |
no test coverage detected