This project has moved and is read-only. For the latest updates, please go here.


Disable enable z buffer using commonstate


is this is the correct way to disable and enable the z buffer before rendering the skydome?
m_Graphics.getContext()->OMSetDepthStencilState(states.DepthNone(), 0);
    m_shape->Draw(sphereWorld,m_Camera.ViewMatrix(), m_Camera.ProjectionMatrix(), Colors::White, m_texture.Get());
Closed Sep 15, 2016 at 7:59 AM by walbourn


ShawnHargreaves wrote May 16, 2016 at 4:49 PM

That won't work, because GeometricPrimitive::Draw overrides all previous device context state (see

Instead you should call OMSetDepthStencilState from inside the setCustomState callback, which is passed to the Draw method. See the Advanced drawing section of for an example of how to use that.