Jump to content
  • Advertisement
Sign in to follow this  
kelley

tex2d,tex2dproj and Nvidia depth textures

This topic is 4116 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!