Merge pull request #184 from Petercov/mapbase-feature/projtex-aspect-fix

Compute aspect ratios on shadow depth textures
This commit is contained in:
Blixibon 2022-04-26 14:38:26 -05:00 committed by GitHub
commit ea85fe20f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4484,13 +4484,18 @@ void CClientShadowMgr::ComputeShadowDepthTextures( const CViewSetup &viewSetup )
} }
CViewSetup shadowView; CViewSetup shadowView;
#ifndef MAPBASE
shadowView.m_flAspectRatio = 1.0f; shadowView.m_flAspectRatio = 1.0f;
#endif
shadowView.x = shadowView.y = 0; shadowView.x = shadowView.y = 0;
shadowView.width = shadowDepthTexture->GetActualWidth(); shadowView.width = shadowDepthTexture->GetActualWidth();
shadowView.height = shadowDepthTexture->GetActualHeight(); shadowView.height = shadowDepthTexture->GetActualHeight();
#ifndef ASW_PROJECTED_TEXTURES #ifndef ASW_PROJECTED_TEXTURES
shadowView.m_bOrtho = false; shadowView.m_bOrtho = false;
shadowView.m_bDoBloomAndToneMapping = false; shadowView.m_bDoBloomAndToneMapping = false;
#ifdef MAPBASE
shadowView.m_flAspectRatio = (flashlightState.m_fHorizontalFOVDegrees / flashlightState.m_fVerticalFOVDegrees);
#endif // MAPBASE
#endif #endif
// Copy flashlight parameters // Copy flashlight parameters
@ -4498,6 +4503,10 @@ void CClientShadowMgr::ComputeShadowDepthTextures( const CViewSetup &viewSetup )
if ( !flashlightState.m_bOrtho ) if ( !flashlightState.m_bOrtho )
{ {
shadowView.m_bOrtho = false; shadowView.m_bOrtho = false;
#ifdef MAPBASE
shadowView.m_flAspectRatio = (flashlightState.m_fHorizontalFOVDegrees / flashlightState.m_fVerticalFOVDegrees);
#endif // MAPBASE
} }
else else
{ {
@ -4506,6 +4515,10 @@ void CClientShadowMgr::ComputeShadowDepthTextures( const CViewSetup &viewSetup )
shadowView.m_OrthoTop = flashlightState.m_fOrthoTop; shadowView.m_OrthoTop = flashlightState.m_fOrthoTop;
shadowView.m_OrthoRight = flashlightState.m_fOrthoRight; shadowView.m_OrthoRight = flashlightState.m_fOrthoRight;
shadowView.m_OrthoBottom = flashlightState.m_fOrthoBottom; shadowView.m_OrthoBottom = flashlightState.m_fOrthoBottom;
#ifdef MAPBASE
shadowView.m_flAspectRatio = 1.0f;
#endif
} }
shadowView.m_bDoBloomAndToneMapping = false; shadowView.m_bDoBloomAndToneMapping = false;