Skip to content

Commit 8cff02f

Browse files
authored
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.
1 parent 0d8eb2e commit 8cff02f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sp/src/game/client/clientshadowmgr.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,8 @@ void CClientShadowMgr::InitDepthTextureShadows()
14941494
#else
14951495
#if defined(MAPBASE) //&& !defined(ASW_PROJECTED_TEXTURES)
14961496
// SAUL: we want to create a *DEPTH TEXTURE* of specific size, so use RT_SIZE_NO_CHANGE and MATERIAL_RT_DEPTH_ONLY
1497-
depthTex.InitRenderTarget( m_nDepthTextureResolution, m_nDepthTextureResolution, RT_SIZE_NO_CHANGE, dstFormat, MATERIAL_RT_DEPTH_ONLY, false, strRTName );
1497+
// However, MATERIAL_RT_DEPTH_ONLY forces point filtering to be enabled which negatively affect PCF, so the standard MATERIAL_RT_DEPTH_NONE works better.
1498+
depthTex.InitRenderTarget( m_nDepthTextureResolution, m_nDepthTextureResolution, RT_SIZE_NO_CHANGE, dstFormat, MATERIAL_RT_DEPTH_NONE, false, strRTName );
14981499
#else
14991500
depthTex.InitRenderTarget( m_nDepthTextureResolution, m_nDepthTextureResolution, RT_SIZE_OFFSCREEN, dstFormat, MATERIAL_RT_DEPTH_NONE, false, strRTName );
15001501
#endif

0 commit comments

Comments
 (0)