Hello Guest

Author Topic: Text Mesh optimization  (Read 4564 times)

RhapsodyGames

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 40
    • View Profile
Text Mesh optimization
« on: October 17, 2013, 03:50:42 pm »
Hello, I'm using 4 fonts in my project.
In some menus about 20-30 textmeshes are visible, it costs a lot of drowcalls. For example, without any textMeshes drawcalls = 30-40, with active textmeshes it grows up to 60-70. I dont know how to optimize it to "1 font = 1 drawcall".
Is this problem have any solution?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Text Mesh optimization
« Reply #1 on: October 17, 2013, 03:56:24 pm »
Each text mesh takes up a certain number of triangles. The max chars field determines this. Set this to as little as you can, as large text meshes can't batch effectively. Eg. once you get to certain number of triangles, it will no longer be effective to batch these.

To get things to be more batch friendly, first sort out the above, and then group things closer in z. Eg. all from font 1 at 1 z value, and so on to help improve batching.

RhapsodyGames

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: Text Mesh optimization
« Reply #2 on: October 17, 2013, 04:38:02 pm »
Thank You, second solution helps me :)