Implemented a fix from VDC so that projected textures can be parented in the movement hierarchy and increased the maximum number of projected textures from 1 to 8

This commit is contained in:
CRRDerek 2016-09-04 16:20:56 -04:00 committed by 1upD
parent 8330254613
commit a5ca814985
2 changed files with 20 additions and 7 deletions

View File

@ -221,15 +221,24 @@ void C_EnvProjectedTexture::UpdateLight( bool bForceUpdate )
g_pClientShadowMgr->SetFlashlightLightWorld( m_LightHandle, m_bLightWorld );
if ( bForceUpdate == false )
{
// The conditional to check if bForceUpdate == false is commented out based on a guide on VDC
// https://developer.valvesoftware.com/wiki/Env_projectedtexture/fixes
// This was done so that projected textures may be parented.
// Change made by Derek Dik on 9/4/2016
//if ( bForceUpdate == false )
//{
g_pClientShadowMgr->UpdateProjectedTexture( m_LightHandle, true );
}
//}
}
void C_EnvProjectedTexture::Simulate( void )
{
UpdateLight( false );
// According to VDC, we want to update the light based on when there is a movement parent
//https://developer.valvesoftware.com/wiki/Env_projectedtexture/fixes
// Change made by Derek Dik on 9/4/2016
UpdateLight( GetMoveParent() != NULL );
BaseClass::Simulate();
}

View File

@ -1290,9 +1290,13 @@ bool CClientShadowMgr::Init()
SetShadowBlobbyCutoffArea( 0.005 );
bool bTools = CommandLine()->CheckParm( "-tools" ) != NULL;
m_nMaxDepthTextureShadows = bTools ? 4 : 1; // Just one shadow depth texture in games, more in tools
// Raise the max projected texture limit to 8
// https://developer.valvesoftware.com/wiki/Env_projectedtexture/fixes
//bool bTools = CommandLine()->CheckParm( "-tools" ) != NULL;
//m_nMaxDepthTextureShadows = bTools ? 4 : 1; // Just one shadow depth texture in games, more in tools
m_nMaxDepthTextureShadows = 8; //with your number
bool bLowEnd = ( g_pMaterialSystemHardwareConfig->GetDXSupportLevel() < 80 );
if ( !bLowEnd && r_shadowrendertotexture.GetBool() )