PDA

View Full Version : OpenGL Depth buffer: Information



02-10-2005, 03:18 PM
Hi!
I need help for this code:

void DrawMyScene()
{

room.drawGLroom
glDepthFunc(GL_ALWAYS);
ball.drawGLBall();
glDepthFunc(GL_LESS);
}

with this code I want design a ball with texture inside a room, alwais visible. When the ball is back a wall of room, i can see him.
In this mode tha ball is alwais visibe, but when hi move in my scene, sometime the texture go away e return.
Why?

mikael_aronsson
02-10-2005, 11:55 PM
Hi !

I am not sure what you mean, but is it GL_ALWAYS you want to use for the depth test function ???

Mikael

-NiCo-
02-11-2005, 03:35 AM
You need to set the depth function before drawing the object, not after.

Nico