www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: kkl on October 24, 2013, 02:51:52 pm

Title: mergeObjects drawcall
Post by: kkl on October 24, 2013, 02:51:52 pm
Hi Egon,

Does mergeObjects() reduce drawcalls? If 10 objects are merged into one, is there going to be one drawcall or 10 drawcalls?
Title: Re: mergeObjects drawcall
Post by: EgonOlsen on October 24, 2013, 03:34:04 pm
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.
Title: Re: mergeObjects drawcall
Post by: kkl on October 24, 2013, 04:05:19 pm
Got it. Reconfirm: Does it mean if there are >10 objects, but only with 2 textures, it should have 2 drawcalls?
Title: Re: mergeObjects drawcall
Post by: EgonOlsen on October 24, 2013, 04:52:50 pm
It might depend on some other variables too, but basically yes.
Title: Re: mergeObjects drawcall
Post by: kkl on October 24, 2013, 05:11:14 pm
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?
Title: Re: mergeObjects drawcall
Post by: EgonOlsen on October 24, 2013, 07:10:34 pm
It also depends on blending modes when using multi texturing, shaders (if used) and additional vertex attributes (if assigned).