PDA

View Full Version : OpenGL Depth Testing



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

Guaripolo
July 9th, 2008, 23:45
woa, what library are you porting??? that sounds interesting...

well i don't know anything about opengl, but i think that you can ask in dreamcast.es, chui is now surrounding there a little bit more, and he surely can help u. I will put this thread there so other people can read it.

Bye!

hiperbou
July 11th, 2008, 17:48
Thanks for answering... I'll try on dreamcast.es

I'm porting my own library hiperGL for c/c++ or Lua

You can see some of the features at
http://hiperbou.se32.com/about/

or download it at sourceforge.

Actually it works on windows, linux, PSP, GP32 and Dreamcast, but I'm waiting to get the 1.0 version before I start to show it officially to the world XD

But, there is a video running on my DC using a software blitter.
http://es.youtube.com/watch?v=vJ2upGObYQ8

Guaripolo
July 15th, 2008, 22:43
wow that's great, maybe you can contact with chui, he's now improving opengl support in kos, maybe he could help you. I've asked in dreamcast.es but no one seems to know about this error. Also you can check out SDL+opengl source code, maybe (if there's a bug) you can fix it and send it to chui, seems like you know about opengl (i don't aWEHwAhe) and it can be very significant to the Dreamcast community.

bye!