Sign in to follow this  
kelley

tex2d,tex2dproj and Nvidia depth textures

Recommended Posts

kelley    122
I have some HLSL shadow mapping code that does some fancy depth texture PCF filtering on on ATI boards. The perspective divide for the shadow map texture coordinate is computed early in the pixel shader. I know that Nvidia cards expect you to use tex2dproj() and automatically does the z compare and the ATI board doesn't do the compare, but what about tex2d() on Nvidia boards? Does tex2d() automatically do the compare? According to the Nvidia GPU programming guide, tex* intrinsics should work (page 54): "NOTE: In ForceWare 61.71 and later, any texture instruction (tex2D, tex2Dlod, etc.) will work correctly with shadow maps." does this mean that I should be able to pass in a 2D tex coord (with the divide already applied), and expect tex2d to already do the depth compare for me? I was thinking this would work, but in my tests it seems to fail. This works on Nvidia boards: shadowValue=tex2Dproj( shadowMap, texCoord ).x; I expect the following to work, but it doesn't in my tests (I'm testing on a Nvidia 8800) - it always returns 1.0f : shadowValue=tex2D(shadowMap,texCoord.xy).x;

Share this post


Link to post
Share on other sites
kelley    122
But if tex2d works with depth textures (as the Nvidia GPU programming guide (http://developer.download.nvidia.com/GPU_Programming_Guide/GPU_Programming_Guide.pdf) would lead me to believe), then wouldn't that mean that tex2d would expect the divide to already have taken place?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this