Sign in to follow this  
matt77hias

32Bit Depth

Recommended Posts

matt77hias    437

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
MJP    19787

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
galop1n    977

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

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