# XNA ignoring the Z-coordinate?

XNA seems to be ignoring my Z coordinate. There is no form of Z-culling at all it seems. How come? I am doing an orthographic projection, and clearing the depth stencil buffer for every draw-call.

My elements rendered are quads with textures, through instancing. These elements have 1 difference in the Z-coordinate in order to eachother, based on theri Z-index.

• Code would help. – The Communist Duck Jun 16 '11 at 12:26
• A better description of what you Are seeing would also help. – James Jun 16 '11 at 17:45

What have you set GraphicsDevice.DepthStencilState to? It should be DepthStencilState.Default to both read and write the depth buffer.