mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-19 19:35:26 +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
|
|
@ -223,7 +223,6 @@ void AdvancedLightBinManager::addLight( LightInfo *light )
|
|||
// Find a shadow map for this light, if it has one
|
||||
ShadowMapParams *lsp = light->getExtended<ShadowMapParams>();
|
||||
LightShadowMap *lsm = lsp->getShadowMap();
|
||||
LightShadowMap *dynamicShadowMap = lsp->getShadowMap(true);
|
||||
|
||||
// Get the right shadow type.
|
||||
ShadowType shadowType = ShadowType_None;
|
||||
|
|
@ -236,7 +235,6 @@ void AdvancedLightBinManager::addLight( LightInfo *light )
|
|||
LightBinEntry lEntry;
|
||||
lEntry.lightInfo = light;
|
||||
lEntry.shadowMap = lsm;
|
||||
lEntry.dynamicShadowMap = dynamicShadowMap;
|
||||
lEntry.lightMaterial = _getLightMaterial( lightType, shadowType, lsp->hasCookieTex() );
|
||||
|
||||
if( lightType == LightInfo::Spot )
|
||||
|
|
@ -376,7 +374,6 @@ void AdvancedLightBinManager::render( SceneRenderState *state )
|
|||
setupSGData( sgData, state, curLightInfo );
|
||||
curLightMat->setLightParameters( curLightInfo, state );
|
||||
mShadowManager->setLightShadowMap( curEntry.shadowMap );
|
||||
mShadowManager->setLightDynamicShadowMap( curEntry.dynamicShadowMap );
|
||||
|
||||
// Set geometry
|
||||
GFX->setVertexBuffer( curEntry.vertBuffer );
|
||||
|
|
@ -405,7 +402,6 @@ void AdvancedLightBinManager::render( SceneRenderState *state )
|
|||
|
||||
// Set NULL for active shadow map (so nothing gets confused)
|
||||
mShadowManager->setLightShadowMap(NULL);
|
||||
mShadowManager->setLightDynamicShadowMap(NULL);
|
||||
GFX->setVertexBuffer( NULL );
|
||||
GFX->setPrimitiveBuffer( NULL );
|
||||
|
||||
|
|
|
|||
|
|
@ -197,7 +197,6 @@ protected:
|
|||
{
|
||||
LightInfo* lightInfo;
|
||||
LightShadowMap* shadowMap;
|
||||
LightShadowMap* dynamicShadowMap;
|
||||
LightMaterialInfo* lightMaterial;
|
||||
GFXPrimitiveBuffer* primBuffer;
|
||||
GFXVertexBuffer* vertBuffer;
|
||||
|
|
|
|||
|
|
@ -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