Advertisement

Batching DrawElements... Efficient?

Started by December 05, 2002 04:06 PM
3 comments, last by aker_jus 22 years, 2 months ago
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!
GraphicsWare|RenderTechhttp://www.graphicsware.com3D Graphics & Solutions
Can''t someone help me on this?
GraphicsWare|RenderTechhttp://www.graphicsware.com3D Graphics & Solutions
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.
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]
Game Core
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?
GraphicsWare|RenderTechhttp://www.graphicsware.com3D Graphics & Solutions

This topic is closed to new replies.

Advertisement