Depth Issue? I dunno..

Member
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..

Hank-

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

Code:
glDisable(GL_DEPTH_TEST);
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:

Code:
glClearDepth(1.0);
glClear(GL_DEPTH_BUFFER_BIT);
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