• Advertisement

Archived

This topic is now archived and is closed to further replies.

Batching DrawElements... Efficient?

This topic is 5553 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In my renderer, I use DrawElements to render my vertices. How would I batch several DrawElements together to get the maximum speed? Would that be efficient enough or should I call DrawElements for the vertices needed and not one DrawElements for all vertices? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
naturally, you can only combine drawelements if both calls use the same renderstate setup. you''ll have to put vertex data for both calls into a single array, and render that. note that you can still render parts of the single array should the need arise.

nvidia has a few documents about application performance on their developer site. you should try to send at least 200 vertices per call, and sending a few thousand per call gives you optimal performance, if i remember correctly.

Share this post


Link to post
Share on other sites
Batch drawelements , i worked with along time ago.
It's good only if use one texture. in fact, drawelement can use one texture bind (unless multitexture) each call.
i tried one huge texture made with small textures. It turned out ok.
Maybe, learn the lock and unlock feature, too.

Right now, i use drawelements instead of glBegin(triangles);
Big perforamnce increase. but, this is for 3d models (like humans).

Bobby

[edited by - bgcjr on December 7, 2002 11:24:45 AM]

Share this post


Link to post
Share on other sites
I see now. So it wouldnt make big difference if I used one glDrawElements for every geometry in my scene, or at least a couple of drawelements, instead of one drawelement for each 3d object class.

Am i correct here?

Share this post


Link to post
Share on other sites

  • Advertisement