Archived

This topic is now archived and is closed to further replies.

SaF

Strange problem

Recommended Posts

When I draw some triangles/quads/anything, OpenGL draw them Front-To-Back instead of Back-To-Front. 1½ week before everything was ok. I played Black and White and today I start again to code and this strange problem appeared.. I have a Voodoo Banshee with driver 1.04.00 (lastest driver I think) Can someone help me?

Share this post


Link to post
Share on other sites
OpenGL draws polygons in the order *you* send them to it!
Check that you haven''t forgotten to enable the depth buffer AND the depth buffer test, and that your depth function is the default one (GL_LESS), that should be enough to get rid of your problems, but maybe I am misunderstanding the thing?

Share this post


Link to post
Share on other sites
If it draws your primitives front to back, then it shouldn''t be rerendering the aame pixels, hense getting you a better time on your card. Privided its Z buffering, if not I can see it being strange putting things in abnormal sequences. Is this problem occuring in your development quests, or in commercial games, or both?

Share this post


Link to post
Share on other sites
/*Vince*/:
Yes I enabled the depth buffer AND the depth buffer test like this:

glDepthFunc(GL_LEQUAL);
glEnable(GL_DEPTH_TEST);
glClearDepth(1.0);

When I put glDepthFunc(GL_LESS) nothing appear...

---

Sulgurth:
Yes it's Z buffering or Z sorting... something like that (dont remember the name).

Only in development.. All my games work fine.. B&W, CS, Half-Life, etc

--

I took some screenshot.. (i actived back face culling to see better)

http://template.free.fr/tmp/1.jpg
http://template.free.fr/tmp/2.jpg
http://template.free.fr/tmp/3.jpg
http://template.free.fr/tmp/4.jpg

It's just a straight line of 4 'prismes à base carré' rotating on the y axis


thank for your help everybody

Simon

Edited by - SaF on April 21, 2001 11:49:00 AM

Edited by - SaF on April 21, 2001 11:56:34 AM

Edited by - SaF on April 21, 2001 12:04:33 PM

Share this post


Link to post
Share on other sites
yes it just you .... but only for those:
http://template.free.fr/tmp/1.jpg
http://template.free.fr/tmp/2.jpg

the brown quad make shit...


but those are ok
http://template.free.fr/tmp/3.jpg
http://template.free.fr/tmp/4.jpg
just to show that isn't every poly that bad "z-buffered"



Those are the worst (some without back face culling). It's supposed to be closed box and they are all the same size and at the same height.
http://template.free.fr/tmp/5.jpg
http://template.free.fr/tmp/6.jpg
http://template.free.fr/tmp/7.jpg
http://template.free.fr/tmp/8.jpg
For exemple, in 5.jpg (back face culling on) the little boxes that seem to be on top are in reallity behind all boxes. I didnt misplaced them: when it rotate, we can see they are correct..




why is it only happening to me???

Edited by - SaF on April 21, 2001 5:48:20 PM

Share this post


Link to post
Share on other sites
when i have a problem like that, i just throw out some of the code that i think might be causeing the problem, and rewrite from scratch, you will be suprised at how easy you might find a "better" way to do things.

also, post all your init code, that will help.

Share this post


Link to post
Share on other sites
Try disabling the face culling and see if the cubes go inside-out. If they do, it's a z buffer problem. If not, I'd blame the model matrix. Is it just upside down and your interpreting it inside out and upside down?

I don't know delphi, btw.

Edited by - smart_idiot on April 24, 2001 12:36:59 PM

Share this post


Link to post
Share on other sites