From 0b5a0c8e2fab67cea3834713364e9515c800dac6 Mon Sep 17 00:00:00 2001 From: ToothpasteVixen <55934692+RoyaleNoir@users.noreply.github.com> Date: Tue, 17 Nov 2020 12:03:22 +1300 Subject: [PATCH] Fixed Shadow filtering Using MATERIAL_RT_DEPTH_ONLY disables hardware filtering, which causes shadows to be pixelated, even with pcf. changing it back to MATERIAL_RT_DEPTH_NONE re-enables hardware filtering, while still working as a depth texture. --- sp/src/game/client/clientshadowmgr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sp/src/game/client/clientshadowmgr.cpp b/sp/src/game/client/clientshadowmgr.cpp index 13e30d1cd0..4ac6f31ed6 100644 --- a/sp/src/game/client/clientshadowmgr.cpp +++ b/sp/src/game/client/clientshadowmgr.cpp @@ -1494,7 +1494,8 @@ void CClientShadowMgr::InitDepthTextureShadows() #else #if defined(MAPBASE) //&& !defined(ASW_PROJECTED_TEXTURES) // SAUL: we want to create a *DEPTH TEXTURE* of specific size, so use RT_SIZE_NO_CHANGE and MATERIAL_RT_DEPTH_ONLY - depthTex.InitRenderTarget( m_nDepthTextureResolution, m_nDepthTextureResolution, RT_SIZE_NO_CHANGE, dstFormat, MATERIAL_RT_DEPTH_ONLY, false, strRTName ); + // However, MATERIAL_RT_DEPTH_ONLY forces point filtering to be enabled which negatively affect PCF, so the standard MATERIAL_RT_DEPTH_NONE works better. + depthTex.InitRenderTarget( m_nDepthTextureResolution, m_nDepthTextureResolution, RT_SIZE_NO_CHANGE, dstFormat, MATERIAL_RT_DEPTH_NONE, false, strRTName ); #else depthTex.InitRenderTarget( m_nDepthTextureResolution, m_nDepthTextureResolution, RT_SIZE_OFFSCREEN, dstFormat, MATERIAL_RT_DEPTH_NONE, false, strRTName ); #endif