View Full Version : DrawArrays vs DrawElements
08-30-2005, 11: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?
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.
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.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.