motion based updates for shadow caching

adds a $pref::Shadows::teleportDis and $pref::Shadows::turnRate (defaults 4, and 1 respectively)
if either is exceeded during a given frame, shadow chaches are forced to refresh themselves.
This commit is contained in:
Azaezel 2016-11-29 14:13:23 -06:00
parent 7af95e6a8e
commit 01419d7935
5 changed files with 55 additions and 19 deletions

View file

@ -304,13 +304,16 @@ bool LightShadowMap::setTextureStage( U32 currTexFlag, LightingShaderConstants*
return false;
}
void LightShadowMap::render( RenderPassManager* renderPass,
const SceneRenderState *diffuseState,
bool _dynamic)
void LightShadowMap::render(RenderPassManager* renderPass,
const SceneRenderState *diffuseState,
bool _dynamic, bool _forceUpdate)
{
// control how often shadow maps are refreshed
if (!_dynamic && (mStaticRefreshTimer->getElapsedMs() < getLightInfo()->getStaticRefreshFreq()))
return;
if (!_forceUpdate)
{
// control how often shadow maps are refreshed
if (!_dynamic && (mStaticRefreshTimer->getElapsedMs() < getLightInfo()->getStaticRefreshFreq()))
return;
}
mStaticRefreshTimer->reset();
/* TODO: find out why this is causing issue with translucent objects