hiperbou
June 29th, 2008, 16:29
Does the Depth Testing actually works?
I'm enabling it using glEnable(GL_DEPTH_TEST); but It seems that it's having a strange behavior...
I'm drawing three planes, using the same code for pc and dreamcast, but I get different results.
glTranslatef(1.0f, 1.0f, 3.0);
glColor4f(0.0f, 0.0f, 1.0f, 1.0f); //blue
plane();
glTranslatef(1.0f, 1.0f, -1.0);
glColor4f(0.0f, 1.0f, 0.0f, 1.0f); //green
plane();
glTranslatef(1.0f, 1.0f, -1.0);
glColor4f(1.0f, 0.0f, 0.0f, 1.0f); //red
plane();
Dreamcast:
http://img514.imageshack.us/img514/8474/nulldcqa2.th.png (http://img514.imageshack.us/my.php?image=nulldcqa2.png)
PC:
http://img104.imageshack.us/img104/2452/openglzb4.th.png (http://img104.imageshack.us/my.php?image=openglzb4.png)
Also, in another test (I'm porting a 2d game library), I tried to inverse the order of the drawings, but it doesn't seem to work
I'm using the latest sources of SDL+OpenGL
I'm enabling it using glEnable(GL_DEPTH_TEST); but It seems that it's having a strange behavior...
I'm drawing three planes, using the same code for pc and dreamcast, but I get different results.
glTranslatef(1.0f, 1.0f, 3.0);
glColor4f(0.0f, 0.0f, 1.0f, 1.0f); //blue
plane();
glTranslatef(1.0f, 1.0f, -1.0);
glColor4f(0.0f, 1.0f, 0.0f, 1.0f); //green
plane();
glTranslatef(1.0f, 1.0f, -1.0);
glColor4f(1.0f, 0.0f, 0.0f, 1.0f); //red
plane();
Dreamcast:
http://img514.imageshack.us/img514/8474/nulldcqa2.th.png (http://img514.imageshack.us/my.php?image=nulldcqa2.png)
PC:
http://img104.imageshack.us/img104/2452/openglzb4.th.png (http://img104.imageshack.us/my.php?image=openglzb4.png)
Also, in another test (I'm porting a 2d game library), I tried to inverse the order of the drawings, but it doesn't seem to work
I'm using the latest sources of SDL+OpenGL