Depth Issue? I dunno..

Posts: 45
Joined: 2002.04
Post: #1
Since I took a long pause from development of my game (Terraforma) I am trying to get back into the flow of things...

Currently I switch to an Orthographic View and draw my UI elements on that flat surface.. but when I zoom on a planet or object, it cuts into the UI onscreen.

Is this a depth issue? will disabling depth testing everytime I draw the UI fix this? Or am I speaking jiberish? Cause I have no idea what this is about..

time to finish reading that red book dealy finally..


/* Drunk...... fix later.... */
Quote this message in a reply
Posts: 365
Joined: 2002.04
Post: #2
You could turn off depth testing (and writing, if you like) like this:

glDepthMask(0); // If you don't want to write to the Z buffer either
That works fine unless your UI objects also need depth testing because they intersect one another. In that case, you can just clear the Z buffer between drawing the scene and drawing the UI:

In either case, you'll need to draw your UI after you draw the scene.

Neil Carter
Nether - Mac games and comic art
Quote this message in a reply
Post Reply