mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Removes current implement of shadow caching
Also removes EC stuff as it's not ready for prime-time yet
This commit is contained in:
parent
f007700646
commit
66cc6fb9d1
141 changed files with 67 additions and 19491 deletions
|
|
@ -360,13 +360,10 @@ void AdvancedLightManager::setLightInfo( ProcessedMaterial *pmat,
|
|||
LightingShaderConstants *lsc = getLightingShaderConstants(shaderConsts);
|
||||
|
||||
LightShadowMap *lsm = SHADOWMGR->getCurrentShadowMap();
|
||||
LightShadowMap *dynamicShadowMap = SHADOWMGR->getCurrentDynamicShadowMap();
|
||||
|
||||
LightInfo *light;
|
||||
if (lsm)
|
||||
light = lsm->getLightInfo();
|
||||
else if ( dynamicShadowMap )
|
||||
light = dynamicShadowMap->getLightInfo();
|
||||
else
|
||||
{
|
||||
light = sgData.lights[0];
|
||||
|
|
@ -436,46 +433,6 @@ void AdvancedLightManager::setLightInfo( ProcessedMaterial *pmat,
|
|||
lsc->mViewToLightProjSC->getType() );
|
||||
}
|
||||
}
|
||||
|
||||
// Dynamic
|
||||
if ( dynamicShadowMap )
|
||||
{
|
||||
if ( lsc->mDynamicWorldToLightProjSC->isValid() )
|
||||
shaderConsts->set( lsc->mDynamicWorldToLightProjSC,
|
||||
dynamicShadowMap->getWorldToLightProj(),
|
||||
lsc->mDynamicWorldToLightProjSC->getType() );
|
||||
|
||||
if ( lsc->mDynamicViewToLightProjSC->isValid() )
|
||||
{
|
||||
// TODO: Should probably cache these results and
|
||||
// not do this mul here on every material that needs
|
||||
// this transform.
|
||||
|
||||
shaderConsts->set( lsc->mDynamicViewToLightProjSC,
|
||||
dynamicShadowMap->getWorldToLightProj() * state->getCameraTransform(),
|
||||
lsc->mDynamicViewToLightProjSC->getType() );
|
||||
}
|
||||
|
||||
shaderConsts->setSafe( lsc->mShadowMapSizeSC, 1.0f / (F32)dynamicShadowMap->getTexSize() );
|
||||
|
||||
// Do this last so that overrides can properly override parameters previously set
|
||||
dynamicShadowMap->setShaderParameters(shaderConsts, lsc);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( lsc->mDynamicViewToLightProjSC->isValid() )
|
||||
{
|
||||
// TODO: Should probably cache these results and
|
||||
// not do this mul here on every material that needs
|
||||
// this transform.
|
||||
MatrixF proj;
|
||||
light->getWorldToLightProj( &proj );
|
||||
|
||||
shaderConsts->set( lsc->mDynamicViewToLightProjSC,
|
||||
proj * state->getCameraTransform(),
|
||||
lsc->mDynamicViewToLightProjSC->getType() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AdvancedLightManager::registerGlobalLight(LightInfo *light, SimObject *obj)
|
||||
|
|
@ -504,7 +461,6 @@ bool AdvancedLightManager::setTextureStage( const SceneData &sgData,
|
|||
ShaderConstHandles *handles )
|
||||
{
|
||||
LightShadowMap* lsm = SHADOWMGR->getCurrentShadowMap();
|
||||
LightShadowMap* dynamicShadowMap = SHADOWMGR->getCurrentDynamicShadowMap();
|
||||
|
||||
// Assign Shadowmap, if it exists
|
||||
LightingShaderConstants* lsc = getLightingShaderConstants(shaderConsts);
|
||||
|
|
@ -522,18 +478,7 @@ bool AdvancedLightManager::setTextureStage( const SceneData &sgData,
|
|||
GFX->setTexture( reg, GFXTexHandle::ONE );
|
||||
|
||||
return true;
|
||||
} else if ( currTexFlag == Material::DynamicShadowMap )
|
||||
{
|
||||
// Dynamic
|
||||
if ( dynamicShadowMap )
|
||||
return dynamicShadowMap->setTextureStage( currTexFlag, lsc );
|
||||
|
||||
S32 reg = lsc->mDynamicShadowMapSC->getSamplerRegister();
|
||||
if ( reg != -1 )
|
||||
GFX->setTexture( reg, GFXTexHandle::ONE );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ( currTexFlag == Material::DynamicLightMask )
|
||||
{
|
||||
S32 reg = lsc->mCookieMapSC->getSamplerRegister();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue