Skip to content

Commit ea85fe2

Browse files
authored
Merge pull request #184 from Petercov/mapbase-feature/projtex-aspect-fix
Compute aspect ratios on shadow depth textures
2 parents e0821e4 + a5ad823 commit ea85fe2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

sp/src/game/client/clientshadowmgr.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4484,20 +4484,29 @@ void CClientShadowMgr::ComputeShadowDepthTextures( const CViewSetup &viewSetup )
44844484
}
44854485

44864486
CViewSetup shadowView;
4487+
#ifndef MAPBASE
44874488
shadowView.m_flAspectRatio = 1.0f;
4489+
#endif
44884490
shadowView.x = shadowView.y = 0;
44894491
shadowView.width = shadowDepthTexture->GetActualWidth();
44904492
shadowView.height = shadowDepthTexture->GetActualHeight();
44914493
#ifndef ASW_PROJECTED_TEXTURES
44924494
shadowView.m_bOrtho = false;
44934495
shadowView.m_bDoBloomAndToneMapping = false;
4496+
#ifdef MAPBASE
4497+
shadowView.m_flAspectRatio = (flashlightState.m_fHorizontalFOVDegrees / flashlightState.m_fVerticalFOVDegrees);
4498+
#endif // MAPBASE
44944499
#endif
44954500

44964501
// Copy flashlight parameters
44974502
#ifdef ASW_PROJECTED_TEXTURES
44984503
if ( !flashlightState.m_bOrtho )
44994504
{
45004505
shadowView.m_bOrtho = false;
4506+
4507+
#ifdef MAPBASE
4508+
shadowView.m_flAspectRatio = (flashlightState.m_fHorizontalFOVDegrees / flashlightState.m_fVerticalFOVDegrees);
4509+
#endif // MAPBASE
45014510
}
45024511
else
45034512
{
@@ -4506,6 +4515,10 @@ void CClientShadowMgr::ComputeShadowDepthTextures( const CViewSetup &viewSetup )
45064515
shadowView.m_OrthoTop = flashlightState.m_fOrthoTop;
45074516
shadowView.m_OrthoRight = flashlightState.m_fOrthoRight;
45084517
shadowView.m_OrthoBottom = flashlightState.m_fOrthoBottom;
4518+
4519+
#ifdef MAPBASE
4520+
shadowView.m_flAspectRatio = 1.0f;
4521+
#endif
45094522
}
45104523

45114524
shadowView.m_bDoBloomAndToneMapping = false;

0 commit comments

Comments
 (0)