PDA

View Full Version : Quads vs Tris



TCBdev
10-13-2000, 11:00 PM
Is there any advantage/disadvantage to passing data to OpenGL as quads over tris?

Thanks,
Nathan

[This message has been edited by TCBdev (edited 10-14-2000).]

Bob
10-14-2000, 01:17 AM
The only advantage would be two less calls to glVertex (and maybe glNormal and glColor aswell). One quad is two triangles, even if you pass it as triangles or a single quad.

edotorpedo
10-14-2000, 02:31 AM
Maybe there is one disadvantage. Four vertices needn't be in one plane. So if you are working with plane-normals (or in this case, quad-normals), it is sometimes impossible to find a normal with four vertices.

But aside from this I can see no disadvantage

Edo

xvs
10-14-2000, 03:25 AM
Bob: If you use a triangle strip to draw the 2 triangles, then you're not gaining (nor loosing) anything from using quads.

cire
10-14-2000, 11:45 PM
A more subtle issue concerns how the quad is tessellated. In most systems, the quad will be split into two triangles, which are then rasterized. This is fine, except there are two choices of diagonals. If you don't care how these diagonals are chosen, then it doesn't matter. Otherwise, be careful, since it does affect vertex lighting.

/ec

Bob
10-15-2000, 06:04 AM
xvs: Err, yes, of course, you are right. But honestly, how much do we gain/loose by drawing a quad in these different ways. Whatever way we use, we will hardly notice a difference unless you are drawing millions of them.

TCBdev
10-15-2000, 10:43 AM
The goal is to have all quads be planar when they go to be rasterized. There is a chance, though, that some will not be totally palnar and the direction of the edge will be important. How do you determine the direction that the edge travels?

Nathan

MarsuGL
10-24-2000, 02:17 AM
I have read somewhere that the graphic cards are actually optimised to draw triangles, so does opengl split the quads into 2 triangles itself or the coder must do it ?
tanks
domi.marsu@caramail.com

Roderic (Ingenu)
10-24-2000, 02:59 AM
Most cards are transforming anything you sent them to triangles strips, so sending directly TRIANGLE_STRIP(s) to them will avoid spending time on software (drivers) conversion.

Learn the hardware before writting software...
[Nice Advice I read somewhere http://www.opengl.org/discussion_boards/ubb/wink.gif ]