PSSM performance

Posted By: Slin

PSSM performance - 03/04/12 16:24

I just found out that tex2D inside an if or else statement prevents the use of dynamic branching. The solution is to use tex2Dlod instead, which will speed up the vp_pssm.fx a lot.
Just replace float fDepth = tex2D(sMap, vShadowTexCoord.xy + vOffset).x; with float fDepth = tex2Dlod(sMap, float4(vShadowTexCoord.xy + vOffset, 0.0f, 0.0f)).x;
Posted By: Rondidon

Re: PSSM performance - 03/04/12 16:54

Approved by me. Heavily increses the performance of my levels while looking just as good. laugh
Posted By: jcl

Re: PSSM performance - 03/05/12 12:41

Thanks! This will be changed.
© 2024 lite-C Forums