mergeObjects drawcall

Started by kkl, October 24, 2013, 02:51:52 PM

Previous topic - Next topic

kkl

Hi Egon,

Does mergeObjects() reduce drawcalls? If 10 objects are merged into one, is there going to be one drawcall or 10 drawcalls?

EgonOlsen

Depends on what you merge. If you merge objects that all use the same textures, then the answer is yes. If the textures differ, you'll have at least as many draw calls as you have different textures.

kkl

Got it. Reconfirm: Does it mean if there are >10 objects, but only with 2 textures, it should have 2 drawcalls?

EgonOlsen

It might depend on some other variables too, but basically yes.

kkl

What are the other variables? It would be great if I know all of them to optimize performance. It's even better if I can get the number of drawcalls per frame, but I know it's kinda hard, isn't it?

EgonOlsen

It also depends on blending modes when using multi texturing, shaders (if used) and additional vertex attributes (if assigned).