Which cards can handle quads in hw?

I think the subject says it all really.

I just wanted to know whether there are any cards on the market at the moment that support rendering quads as well as triangles.

We have just got a GeForce 256 and the boss here says it can, but I cannot find any evidence of it anywhere…NVidia guys?

Thanks,
Luke A. Guest.

Uhm, as far as I know, a quad is just two triangles, and most newer cards generally accelerates the drawing of triangles.Why don’t you write a program to draw a few triangles, and then a few quads, bench it and see for yourself.

Originally posted by Bob:
Uhm, as far as I know, a quad is just two triangles, and most newer cards generally accelerates the drawing of triangles.Why don’t you write a program to draw a few triangles, and then a few quads, bench it and see for yourself.

Well, yes a quad is just 2 triangles. But! If the card can handle quads direct, then it only need to transform 4 vertices rather than 6!

This is what I was asking and there is no real way to tell if the card can handle it in hardware by benchmarking it.

Thanks,
Luke.

You could still send those four vertices as a triangle strip too, to get the same quad drawn.

not sure about this, but isn’t OpenGL converting everything to triangles internally anyway? The benefit of doing it yourself beforehand is that the OpenGL doesn’t have to do it every frame, so it’s faster…

From a strict T&L point of view, handling real quads may be interresting (although it may be viewed as a tri-strip with just 2 triangles) ; but from the rasterizing point of view, quads & beyond are real pain to handle : they don’t have good behavior for linear interpolation (no constant gradients, no 'rotational invariance (or so), …).

So I believe handling the correct rasterization of such primitives costs much more than implementing a good triangle rasterizer and decompositing the ‘higher-level’ primitives.

At least it is true for software rasterization, so it should be for hardware too !

All hardware I know of converts everything to triangles before rasterization, but primitive assembly hardware in GeForce products recognize all the OpenGL types: QUADS, QUAD_STRIP, TRIANGLES, etc.

Since the hardware recognizes these types directly, there is no extra overhead in using them. That is, the driver does not have to re-order the data before sending it to the hardware.

Cass

The PowerVR is the only hardware I know of which handles quads directly. Go ahead and use GL_QUADS, if the driver is optimized properly , it’ll turn each quad into a tri strip, and so you’ll only need 4 verts. Don’t worry about what the driver is doing internally. If you like quads, use 'em! I do use them for certain things. BUT be aware that a quad can be split into 2 triangle in 2 different ways. This can occasionally cause problems.

Originally posted by cass:
[b]
All hardware I know of converts everything to triangles before rasterization, but primitive assembly hardware in GeForce products recognize all the OpenGL types: QUADS, QUAD_STRIP, TRIANGLES, etc.

Since the hardware recognizes these types directly, there is no extra overhead in using them. That is, the driver does not have to re-order the data before sending it to the hardware.

Cass[/b]

That’s something I do not quite understand : I knew all cards were doing what you describe.

But when I and others used to create our own 3D engines on Atari/Amiga, none of our algorithms needed to split geometry into triangle… I don’t want to go further into how we rasterized things (if people are interested, simply e-mail me) but we REALLY didn’t have to do that…

Now, of course, our engines were not OpenGL or D3D or Glide or XXXXX. But I do not see where the need for triangles come from… Is it simply a HW constraint ? Or is it a speed constraint (this one I would understand !) ?

Nicolas, I know QUADS are not ideal for color interpolation: with the methods we used, there were certainly occasional strange things… On the other hand, when I ask my GeForce to draw a QUAD with four non-colorspace-planar colors for each vertex, one of the quad diagonals is clearly seen on the screen (that’s where the quad is split into triangles…). So, what’s the best approach ?

There must be something I am missing somewhere : everybody splits into triangles these days…

My question is : Why ?

Best regards.

Eric

P.S. : I might try to adapt one of my Atari Falcon 3D engines to PC just for fun…
By the way, if you want to see such a 3D engine implemented in Java, go to:
http://equinox.planet-d.net/

Equinox was one of the famous groups on Atari ST. They have very good 3D skills !

Nicolas, I know QUADS are not ideal for color interpolation: with the methods we used, there were certainly occasional strange things…

I’ve forgot many technical and mathematical details linked to rasterization, but, for what I remember, you simply get ugly results when using linear interpolation to rasterize raw quads ; coz for what I know, linear interpolation is ‘not accurate’ (perhaps even wrong) in this case. Can’t remember the details, but I dropped all the quad stuff long time ago with with my first gouraud rasterizer… Don’t know if you heard of them but there are very nice articles by Chris Hecker ( www.d6.com ) that demonstrates several great triangle properties for linear interpolation; that should convince you that triangles are just cool for rasterizing.

On the other hand, when I ask my GeForce to draw a QUAD with four non-colorspace-planar colors for each vertex, one of the quad diagonals is clearly seen on the screen (that’s where the quad is split into triangles…).

I believe this is normal, as the color interpolation is linear (‘perspective’ linear), you can’t expect to have nice results when giving non colorspace-planar colors. This is the kinda thing that need to be tweaked with texture maps…

Ok, so quads may not be the best primitive to use for large 3D meshes, but surely they’d be useful for 2D user interfaces where most of the meshes are essentially quads?

This would speed that up a hell of a lot.

Surely there ar some large meshes that can use quads without looking crap?

Thanks,
Luke.

It is mathematically impossible to come up with a “good” way of interpolating colors on a quad. Same goes for interpolating texture coordinates or anything else. The color values are supposed to be on a plane, and with a triangle, you have 3 (x,y) locations and 3 color vectors (r,g,b,a). That’s a perfect fit. Quads are overconstrained – essentially, 3 unknowns, 4 equations.

Everyone just renders triangles, so yes, we just split it up into triangles.

If you care what way the diagonal goes, use a triangle strip or fan instead of a quad, and use a triangle strip instead of a quad strip.

  • Matt