• Advertisement
Sign in to follow this  

3D on 2D Plane (Z-Fighting)

This topic is 4550 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'm currently working on a 3D in 2D project using 3D graphics to draw a 2D game. I'm trying to get weapons fire working on the 2D plane but I'm having trouble with the Z-Buffer. I'm rendering all of the weapons as quads on the 2D plane at the same depth and blending them. With backgroud objects this works fine beacuse it is drawn in the correct order for blending, but in terms of overlapping weapons fire I have problems getting the last drawn weapon (The correctly blended one) to render on top of an earlier drawn weapon. I've looked at a couple of the solutions people have address such as polygon offset and stenciling but I'm not sure which is best for my current problem. Any help/advice would be greatly appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Ahh, thanks, that does exactly what I wanted.

For anyone who didn't know what he meant by disable depth writes (I didn't)

glDepthMask(GL_FALSE)

Share this post


Link to post
Share on other sites
Is there a performance gain from using glDepthMask over glEnable/glDisable(GL_DEPTH_TEST)?

Share this post


Link to post
Share on other sites
Disabling the depth test also implicitly disables depth writes.

Enigma

Share this post


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

  • Advertisement