Skip to main content
GameDev.net gamedev.net
🔒 Locked

Strange problem

Started by SaF Apr 20, 2001 at 11:04 PM 7 replies 350+ views
Original Post
SaF
SaF
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?
/*Vince*/
/*Vince*/
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?
Sulgurth
Sulgurth
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?
As humans we are all gods, just to different extents of power.
SaF
SaF
/*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
/*Vince*/
/*Vince*/
Maybe it''s me, but I can''t see anything wrong in the rendering of your 5 shapes? All faces appear to be correctly z sorted!
SaF
SaF
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
Eber Kain
Eber Kain
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.
www.EberKain.comThere it is, Television, Look Listen Kneel Pray.
SaF
SaF
Here is my prog's source and the Windows init source (it's in delphi but very easy to understand) but i'm sure it's not that..

On another forum someone said me to change my video card driver...

thank

Edited by - SaF on April 22, 2001 12:55:42 PM
smart_idiot
smart_idiot
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
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.