Jump to content
  • Advertisement
Sign in to follow this  

ClearDepthStencilView madness

This topic is 1218 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 was trying to render some texels by using a depth stencil which I cleared before rendering to value 2^24 but nothing was rendered.

So finally I found that the default RasterizerStateState has DepthClipEnable = TRUE; wich means that this clip will happen "0 <= z <= w" after the vertex shader.

I changed RasterizerStateState, still no texels were rendered then I found this in the ClearDepthStencilView documentation:

pDepthStencilView [in]

Type: ID3D10DepthStencilView*

Pointer to the depth stencil to be cleared.

ClearFlags [in]

Type: UINT

Which parts of the buffer to clear. See D3D10_CLEAR_FLAG.

Depth [in]


Clear the depth buffer with this value. This value will be clamped between 0 and 1.

Stencil [in]

Type: UINT8

Clear the stencil buffer with this value.


just why?

Share this post

Link to post
Share on other sites

1.0 means maximum depth buffer value, and 0.0 means minimum depth buffer value, so for a 24bit fixed point format, 1 will be remapped to 224-1, and 0 will be remapped to 0.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!