• Advertisement
Sign in to follow this  

Direct3D11 without a Depth/Stencil (back)buffer

This topic is 1115 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 wondering if a depth/stencil buffer is required for Direct3D11 to function correctly - it seems pretty integrated into the pipeline. I will be developing a personal 2D game engine soon and I really have no use for a depth/stencil buffer. I will be using the painters algorithm and multiple render targets to draw everything well enough.

 

I made a quick test and noticed Direct3D11 seems to run alright without a depth/stencil buffer. Other than not setting up a depth-stencil Texture2D, DepthStencilView and specificing null when assigning rendertargets to the swap chain is there anything else I should inform the state machine about?

 

Thanks,

Xanather

Edited by Xanather

Share this post


Link to post
Share on other sites
Advertisement


Other than not setting up a depth-stencil Texture2D, DepthStencilView and specificing null when assigning rendertargets to the swap chain is there anything else I should inform the state machine about?

That's pretty much it. If you wanted to enable/disable the depth-stencil buffer, you would also need to create a ID3D11DepthStencilState object, and bind it with OMSetDepthStencilState. I think OMSetDepthStencilState takes NULL too, but you don't have to set it if you're never going to enable depth testing/writing - they are disabled by default.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement