| 305 | } |
| 306 | |
| 307 | void LightShadowMap::render(RenderPassManager* renderPass, |
| 308 | const SceneRenderState *diffuseState, |
| 309 | bool _dynamic, bool _forceUpdate) |
| 310 | { |
| 311 | if (!_forceUpdate) |
| 312 | { |
| 313 | // control how often shadow maps are refreshed |
| 314 | if (!_dynamic && (mStaticRefreshTimer->getElapsedMs() < getLightInfo()->getStaticRefreshFreq())) |
| 315 | return; |
| 316 | } |
| 317 | mStaticRefreshTimer->reset(); |
| 318 | |
| 319 | /* TODO: find out why this is causing issue with translucent objects |
| 320 | if (_dynamic && (mDynamicRefreshTimer->getElapsedMs() < getLightInfo()->getDynamicRefreshFreq())) |
| 321 | return; |
| 322 | mDynamicRefreshTimer->reset(); |
| 323 | */ |
| 324 | |
| 325 | mDebugTarget.setTexture( NULL ); |
| 326 | _render( renderPass, diffuseState ); |
| 327 | mDebugTarget.setTexture( mShadowMapTex ); |
| 328 | |
| 329 | // Add it to the used list unless we're been updated. |
| 330 | if ( !mLastUpdate ) |
| 331 | { |
| 332 | AssertFatal( !smUsedShadowMaps.contains( this ), "LightShadowMap::render - Used shadow map inserted twice!" ); |
| 333 | smUsedShadowMaps.push_back( this ); |
| 334 | } |
| 335 | |
| 336 | mLastUpdate = Sim::getCurrentTime(); |
| 337 | } |
| 338 | |
| 339 | BaseMatInstance* LightShadowMap::getShadowMaterial( BaseMatInstance *inMat ) const |
| 340 | { |
nothing calls this directly
no test coverage detected