View Full Version : GL_QUAD_GRID
06-15-2001, 01:40 AM
I think it would be nice to add a new kind of geometric primitive : grids.
In some cases, you have to draw a rectangular grid of faces, like when you simulate a water surface, or cloths.
At present, I'm using Quad Strips, but I still have to send twice some indices to OpenGL, and I have to use degenerated quads on borders (I make only one call to glDrawElements for one complete grid).
I would like to make a call to something like :
06-16-2001, 02:40 PM
Nice thought, but I don't think it'd buy you much in practice.
GL_TRIANGLE_STRIP and GL_QUAD_STRIP boost efficiency because they can reuse transform/setup calculations for the last 2 or 3 vertices issued.
With GL_QUAD_GRID you wouldn't get any such reuse until you'd completed the current strip and come to the same point on the NEXT strip. By that time, the shared vertices will almost certainly have been pushed out of the cache.
06-18-2001, 12:04 PM
Wouldn't be a problem if GL could store the last 2*n specified vertices.
Let's say you have an n x m grid. You first specify the first row( n vertices), with nothing rendered. Then you specify the next row, a strip is rendered at the end, the second row becomes the first one, and you can specify the next row.
Grids would really be efficient used with e.g. Bézier patches. When you construct an n x m grid from triangle strips you have to redefine (n-2)*m vertices. (or n*(m-2) respectively)
06-21-2001, 07:12 AM
It's my understanding that some cards already handle strips (in hardware) as an Mx1 patch. I have not read this in hardware specs personaly, so I can only mention this as hear-say.
It would be nice, in these situations, to fully exploit the potential performance boost.
I'll note in parting, however, that the feature your suggesting could be mimicked using the 'compiled vertex array' extension and a little looping.
07-08-2001, 10:55 PM
GL_QUAD_GRID should be added to GL, propably this will change the way setup vertices are cached in the drivers/graphics card.
07-12-2001, 03:29 PM
Why a quad grid? I think it would make more sense to use a triangle grid, of which quads are a subset. In general, quads are harder to work with because special care must be taken to ensure that the vertices of a quad lie on a plane. In a triangle, the vertices can be placed arbitrarily and still create legal geometry.
[This message has been edited by Decimal Dave (edited 07-12-2001).]
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.