HUD Always draw on top?

I am working on a heads up display interface using/rendering quads.

How could I ensure that the interface will always be drawn over the world geomatry of the game?

Do I need to somhow modify the ZBuffer?

I am pretty sure you just need to render your display interface last. Swith to Ortho view and render last. You can also turn gldepthmask(false) before drawing your GUI, and then turn it on again (set to true). That way you ensure is drawn ontop. That would be enough (if not others will correct me :slight_smile: )

The point is: don’t use the zbuffer, use ortho view and forget about the third dimension!

Cheers,
Rod

if not others will correct me
:slight_smile:
Actually you need to disable the depth test: glDisable(GL_DEPTH_TEST). Depth mask is irrelevant if you draw your interface at the end.

Originally posted by Rodrix:
You can also turn gldepthmask(false) before drawing your GUI, and then turn it on again (set to true). That way you ensure is drawn ontop.
No. The depth mask controls write to the depth buffer not testing aginst it. The testing can be disabled by disabling the depth buffer using glDisable(GL_DEPTH_TEST) or by changing depth function to GL_ALWAYS.