I am drawing a scene (Direct3D) with some objects, and at the end, I want to draw another object (the red teapot) which will be in front of all the other objects.
Here is a screenshot: screenshot
I used ‘RenderState.ZBufferFunction = Compare.NotEqual’ to do that but this has as a result to ruin the red teapot. Is there a way to solve this problem?
One option would be to clear the z-buffer and then render the red teapot. It sounds as if you still need to do depth testing when rendering the teapot (because bits of the teapot need to be tested against other bits of the teapot), but that you want to ignore all the things that have been rendered before. The easiest way to arrange that is to clear the z-buffer after everything else and before the red teapot.