PDA

View Full Version : DrawArrays vs DrawElements



nik_bg
08-30-2005, 10:09 PM
Could you advise me what kind of mesh structure is suitable for DrawArrays and what for DrawElements? My observaton is that DrawArrays is best for strips, where vertex array have almost no duplications. What do you think?

10x

Nik.

Obli
08-31-2005, 08:39 AM
That's correct.
The more vertices are being re-used, the more you need DrawElements. If no vertices are being re-used, then you may do it with DrawArrays but I never benchmarked the performance difference for real so take my words with some salt.

Hlz
08-31-2005, 08:31 PM
Yeah, use glDrawElements everywhere. Indexed vertex arrays are the way to go for most everything, not only for bandwidth savings, but for pre and post T&L cache utilization. Use 16bit indices if possible, and keep your vertices aligned on 32 byte boundaries (pad if needed). DrawArrays with strips isn't bad (can still see cache usage), but in general, elements are better. As Obli pointed out, always bench and see.