Skip to main content
GameDev.net gamedev.net
🔒 Locked

Direct3D11 without a Depth/Stencil (back)buffer

Started by Xanather Jan 29, 2015 at 12:59 PM 1 replies 3.7k views
Original Post
Xanather
Xanather

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

tonemgub
tonemgub




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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.