PDA

View Full Version : Quake3 and front face culling



Anders
02-12-2003, 02:53 AM
Hi

It seems that Quake 3 uses front face culling to render both levels and models. It seems to me that using back face culling is the normal thing to do, so I was wondering if anyone knew the reason why they chose to use front face culling.

-Anders

AdrianD
02-12-2003, 03:40 AM
maybe because they used a differend winding order for their triangles than openGL usualy uses ?

a backface culled triangle with indicies 0 1 2
looks similiar to a frontface culled triangle with indicies 2 1 0

another reason could be: when the triangles are created in an left-handed coordinate system and are displayed in a right-handed one, the normals of the trianlge are inverted. and therefore one must reverese the winding oder or the culling function to display them correctly.

Coriolis
02-12-2003, 01:20 PM
AdrianD's first guess was right. Quake3 uses front face culling because the windings that it gives to OpenGL are backwards to the way that OpenGL has its default windings. Back face culling by any other name is still the same (though it may be more confusing).

rgpc
02-12-2003, 06:19 PM
Originally posted by Coriolis:
Quake3 uses front face culling because the windings that it gives to OpenGL are backwards to the way that OpenGL has its default windings.

This might be a tie-over from using LW as their modeller - LW also has it's winding "backwards" when compared to OpenGL's default.

jwatte
02-12-2003, 06:37 PM
It's one thing to cull front faces versus back faces; it's another to decide that front faces are clockwise winding vs counterclockwise.

Personally, I find it less confusing to say "quake seems to treat clockwise winding as front faces" because then when you say "render back faces into the shadow buffer" it still is unambiguous :-)

jwatte
02-12-2003, 06:40 PM
Oh no! I said shadow buffer!

(bonus points if you get the reference)

Nicolas Lelong
02-13-2003, 01:22 AM
Just curious to know if anybody sees a reason why they (ID soft.) did not use 'glFrontFace(GL_CW)' instead of using 'glCullFace' ?

compability ? performance ?

---

jwatte: has it something to do with corinne and her showdown http://www.opengl.org/discussion_boards/ubb/smile.gif

harsman
02-13-2003, 05:57 AM
You were referring to this (http://www.cs.unc.edu/~lastra/Courses/Papers/Wang_Molnar_Second_Depth_Shadow.pdf) perhaps? Or were you talking about item buffer shadows? Yuck.

AdrianD
02-13-2003, 06:38 AM
Originally posted by Nicolas Lelong:
Just curious to know if anybody sees a reason why they (ID soft.) did not use 'glFrontFace(GL_CW)' instead of using 'glCullFace' ?


i guess, this is just because the original quake and its formats wasn't designed for OpenGL. (quake was a SOFTWARE RENDERED game, and had nothing to do with openGL)

Anders
02-13-2003, 06:50 AM
Why would that have anything to do with OpenGL calls? I know that Quake1 was designed for software rendering at first and that the triangle vertices thus were specified in another order than the "normal" OpenGL order. But wouldn't you still have the choice between using glFrontFace(GL_CW) and glCullFace(GL_FRONT)? I don't know wether one should prefer the one above the other wrt. performance.

JONSKI
02-13-2003, 07:17 AM
Meybe he did it to confuse us.

zed
02-13-2003, 11:00 AM
i believe there was a debate about 4 months ago over the correct term for the technique

Coriolis
02-13-2003, 01:40 PM
My personal guess is laziness overcame pedantics.

jwatte
02-13-2003, 07:28 PM
Nicolas got the reference.