Author Topic: mergeObjects drawcall  (Read 841 times)

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
mergeObjects drawcall
« 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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: mergeObjects drawcall
« Reply #1 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.

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
Re: mergeObjects drawcall
« Reply #2 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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: mergeObjects drawcall
« Reply #3 on: October 24, 2013, 04:52:50 pm »
It might depend on some other variables too, but basically yes.

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
Re: mergeObjects drawcall
« Reply #4 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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: mergeObjects drawcall
« Reply #5 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).