iDevGames Forums
Faster Sprites? - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: Faster Sprites? (/thread-3308.html)



Faster Sprites? - Blacktiger - May 2, 2007 08:18 PM

Does anyone know if drawing a sprite would be done faster on two triangles rather than one quad?

Mostly I just want to know for curiosities' sake as I figure there are a lot of better ways to speed up the rendering of sprites. For example, grouping common sprites so you only need one glBindTexture call.


Faster Sprites? - AnotherJake - May 2, 2007 10:59 PM

Blacktiger Wrote:Does anyone know if drawing a sprite would be done faster on two triangles rather than one quad?
One quad *is* two triangles. The quad is faster because two of the six vertices needed for the two coplanar triangles of the quad are only sent once. Trying to speed up textured quads for sprites in OpenGL is an impractical exercise in my experience.


Faster Sprites? - arekkusu - May 3, 2007 08:54 AM

It is actually possible that the quad is faster, if the renderer is written to special-case screen-aligned quads and turn the blit into essentially a memcpy, instead of interpolating attributes across two triangles. But this is only a possibility in a software rasterizer, all hardware is going to break the quad into two triangles.


Faster Sprites? - Blacktiger - May 3, 2007 04:25 PM

AnotherJake Wrote:One quad *is* two triangles. The quad is faster because two of the six vertices needed for the two coplanar triangles of the quad are only sent once. Trying to speed up textured quads for sprites in OpenGL is an impractical exercise in my experience.

As I said, mostly I'm just curious. Is there a difference then between drawing a quad and drawing two triangles in a triangle strip?


Faster Sprites? - AnotherJake - May 3, 2007 04:30 PM

Not that I am aware of.