Jump to content
  • Advertisement
Sign in to follow this  
matt77hias

32Bit Depth

This topic is 407 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

The "HLSL Development Cookbook" uses DXGI_FORMAT_D32_UNORM/DXGI_FORMAT_R32_UNORM formats for the shadow map DSV/RSV. Unfortunately, these DXGI formats do not seem to exist (and if they did, I probably created all my D(S)Vs with the DXGI_FORMAT_D32_UNORM). Are these formats removed or is it just another erratum in the already large set for that book?

The closest DXGI format is DXGI_FORMAT_D24_UNORM_S8_UINT, I presume?

Share this post


Link to post
Share on other sites
Advertisement

Those formats have never existed. Even if they did, they wouldn't make much sense since the 32-bit fixed-point precision would be lost upon being converted to a 32-bit float. 

So yeah, the closest format is the D24_UNORM. You can also use D32_FLOAT, but if you use that then I would reversing your depth buffer  (as discussed in this earlier thread).

Share this post


Link to post
Share on other sites
27 minutes ago, MJP said:

they wouldn't make much sense since the 32-bit fixed-point precision would be lost upon being converted to a 32-bit float

 I see: the IEEE 754 mantissa is 23 bits. Thanks.

Edited by matt77hias

Share this post


Link to post
Share on other sites

It is worth to note that there is one case you may want the unorm behavior and d16 is usually enough. It is with orthographic projection ( directional lights  ), in that case, there is no perspective divide and you will achieve better precision by using a UNORM versus FLOAT. Plus you save half the memory of going 32bits.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!