mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-15 13:16:58 +00:00
add source-sdk-2013
This commit is contained in:
@@ -91,7 +91,7 @@ static ConVar r_flashlightmodels( "r_flashlightmodels", "1" );
|
||||
static ConVar r_shadowrendertotexture( "r_shadowrendertotexture", "0" );
|
||||
static ConVar r_flashlight_version2( "r_flashlight_version2", "0", FCVAR_CHEAT | FCVAR_DEVELOPMENTONLY );
|
||||
|
||||
ConVar r_flashlightdepthtexture( "r_flashlightdepthtexture", "1", FCVAR_ALLOWED_IN_COMPETITIVE );
|
||||
ConVar r_flashlightdepthtexture( "r_flashlightdepthtexture", "1" );
|
||||
|
||||
#if defined( _X360 )
|
||||
ConVar r_flashlightdepthres( "r_flashlightdepthres", "512" );
|
||||
@@ -1180,6 +1180,7 @@ CClientShadowMgr::CClientShadowMgr() :
|
||||
//-----------------------------------------------------------------------------
|
||||
CON_COMMAND_F( r_shadowdir, "Set shadow direction", FCVAR_CHEAT )
|
||||
{
|
||||
Vector dir;
|
||||
if ( args.ArgC() == 1 )
|
||||
{
|
||||
Vector dir = s_ClientShadowMgr.GetShadowDirection();
|
||||
@@ -1189,7 +1190,6 @@ CON_COMMAND_F( r_shadowdir, "Set shadow direction", FCVAR_CHEAT )
|
||||
|
||||
if ( args.ArgC() == 4 )
|
||||
{
|
||||
Vector dir;
|
||||
dir.x = atof( args[1] );
|
||||
dir.y = atof( args[2] );
|
||||
dir.z = atof( args[3] );
|
||||
@@ -1199,6 +1199,8 @@ CON_COMMAND_F( r_shadowdir, "Set shadow direction", FCVAR_CHEAT )
|
||||
|
||||
CON_COMMAND_F( r_shadowangles, "Set shadow angles", FCVAR_CHEAT )
|
||||
{
|
||||
Vector dir;
|
||||
QAngle angles;
|
||||
if (args.ArgC() == 1)
|
||||
{
|
||||
Vector dir = s_ClientShadowMgr.GetShadowDirection();
|
||||
@@ -1210,8 +1212,6 @@ CON_COMMAND_F( r_shadowangles, "Set shadow angles", FCVAR_CHEAT )
|
||||
|
||||
if (args.ArgC() == 4)
|
||||
{
|
||||
Vector dir;
|
||||
QAngle angles;
|
||||
angles.x = atof( args[1] );
|
||||
angles.y = atof( args[2] );
|
||||
angles.z = atof( args[3] );
|
||||
@@ -1802,9 +1802,6 @@ ClientShadowHandle_t CClientShadowMgr::CreateProjectedTexture( ClientEntityHandl
|
||||
if( !( flags & SHADOW_FLAGS_FLASHLIGHT ) )
|
||||
{
|
||||
IClientRenderable *pRenderable = ClientEntityList().GetClientRenderableFromHandle( entity );
|
||||
if ( !pRenderable )
|
||||
return m_Shadows.InvalidIndex();
|
||||
|
||||
int modelType = modelinfo->GetModelType( pRenderable->GetModel() );
|
||||
if (modelType == mod_brush)
|
||||
{
|
||||
@@ -2387,10 +2384,7 @@ void CClientShadowMgr::BuildOrthoShadow( IClientRenderable* pRenderable,
|
||||
// Visualization....
|
||||
//-----------------------------------------------------------------------------
|
||||
void CClientShadowMgr::DrawRenderToTextureDebugInfo( IClientRenderable* pRenderable, const Vector& mins, const Vector& maxs )
|
||||
{
|
||||
if ( !debugoverlay )
|
||||
return;
|
||||
|
||||
{
|
||||
// Get the object's basis
|
||||
Vector vec[3];
|
||||
AngleVectors( pRenderable->GetRenderAngles(), &vec[0], &vec[1], &vec[2] );
|
||||
@@ -2572,11 +2566,8 @@ static void LineDrawHelper( const Vector &startShadowSpace, const Vector &endSha
|
||||
Vector3DMultiplyPositionProjective( shadowToWorld, startShadowSpace, startWorldSpace );
|
||||
Vector3DMultiplyPositionProjective( shadowToWorld, endShadowSpace, endWorldSpace );
|
||||
|
||||
if ( debugoverlay )
|
||||
{
|
||||
debugoverlay->AddLineOverlay( startWorldSpace + Vector( 0.0f, 0.0f, 1.0f ),
|
||||
endWorldSpace + Vector( 0.0f, 0.0f, 1.0f ), r, g, b, false, -1 );
|
||||
}
|
||||
debugoverlay->AddLineOverlay( startWorldSpace + Vector( 0.0f, 0.0f, 1.0f ),
|
||||
endWorldSpace + Vector( 0.0f, 0.0f, 1.0f ), r, g, b, false, -1 );
|
||||
}
|
||||
|
||||
static void DebugDrawFrustum( const Vector &vOrigin, const VMatrix &matWorldToFlashlight )
|
||||
@@ -2940,6 +2931,7 @@ void CClientShadowMgr::PreRender()
|
||||
unsigned short i = m_DirtyShadows.FirstInorder();
|
||||
while ( i != m_DirtyShadows.InvalidIndex() )
|
||||
{
|
||||
MDLCACHE_CRITICAL_SECTION();
|
||||
ClientShadowHandle_t& handle = m_DirtyShadows[ i ];
|
||||
Assert( m_Shadows.IsValidIndex( handle ) );
|
||||
UpdateProjectedTextureInternal( handle, false );
|
||||
@@ -2949,7 +2941,7 @@ void CClientShadowMgr::PreRender()
|
||||
|
||||
// Transparent shadows must remain dirty, since they were not re-projected
|
||||
int nCount = m_TransparentShadows.Count();
|
||||
for ( i = 0; i < nCount; ++i )
|
||||
for ( int i = 0; i < nCount; ++i )
|
||||
{
|
||||
m_DirtyShadows.Insert( m_TransparentShadows[i] );
|
||||
}
|
||||
@@ -3179,9 +3171,9 @@ void CClientShadowMgr::UpdateProjectedTextureInternal( ClientShadowHandle_t hand
|
||||
VPROF_BUDGET( "CClientShadowMgr::UpdateProjectedTextureInternal", VPROF_BUDGETGROUP_SHADOW_DEPTH_TEXTURING );
|
||||
|
||||
Assert( ( shadow.m_Flags & SHADOW_FLAGS_SHADOW ) == 0 );
|
||||
ClientShadow_t& shadowClient = m_Shadows[handle];
|
||||
ClientShadow_t& shadow = m_Shadows[handle];
|
||||
|
||||
shadowmgr->EnableShadow( shadowClient.m_ShadowHandle, true );
|
||||
shadowmgr->EnableShadow( shadow.m_ShadowHandle, true );
|
||||
|
||||
// FIXME: What's the difference between brush and model shadows for light projectors? Answer: nothing.
|
||||
UpdateBrushShadow( NULL, handle );
|
||||
@@ -3975,8 +3967,8 @@ void CClientShadowMgr::ComputeShadowDepthTextures( const CViewSetup &viewSetup )
|
||||
}
|
||||
|
||||
// Set depth bias factors specific to this flashlight
|
||||
CMatRenderContextPtr pRenderContextMat( materials );
|
||||
pRenderContextMat->SetShadowDepthBiasFactors( flashlightState.m_flShadowSlopeScaleDepthBias, flashlightState.m_flShadowDepthBias );
|
||||
CMatRenderContextPtr pRenderContext( materials );
|
||||
pRenderContext->SetShadowDepthBiasFactors( flashlightState.m_flShadowSlopeScaleDepthBias, flashlightState.m_flShadowDepthBias );
|
||||
|
||||
// Render to the shadow depth texture with appropriate view
|
||||
view->UpdateShadowDepthTexture( m_DummyColorTexture, shadowDepthTexture, shadowView );
|
||||
@@ -3998,7 +3990,7 @@ static void SetupBonesOnBaseAnimating( C_BaseAnimating *&pBaseAnimating )
|
||||
}
|
||||
|
||||
|
||||
void CClientShadowMgr::ComputeShadowTextures( const CViewSetup &viewShadow, int leafCount, LeafIndex_t* pLeafList )
|
||||
void CClientShadowMgr::ComputeShadowTextures( const CViewSetup &view, int leafCount, LeafIndex_t* pLeafList )
|
||||
{
|
||||
VPROF_BUDGET( "CClientShadowMgr::ComputeShadowTextures", VPROF_BUDGETGROUP_SHADOW_RENDERING );
|
||||
|
||||
@@ -4009,7 +4001,7 @@ void CClientShadowMgr::ComputeShadowTextures( const CViewSetup &viewShadow, int
|
||||
|
||||
MDLCACHE_CRITICAL_SECTION();
|
||||
// First grab all shadow textures we may want to render
|
||||
int nCount = s_VisibleShadowList.FindShadows( &viewShadow, leafCount, pLeafList );
|
||||
int nCount = s_VisibleShadowList.FindShadows( &view, leafCount, pLeafList );
|
||||
if ( nCount == 0 )
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user