2D Toolkit Forum

2D Toolkit => Support => Topic started by: RhapsodyGames on October 17, 2013, 03:50:42 pm

Title: Text Mesh optimization
Post by: RhapsodyGames 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?
Title: Re: Text Mesh optimization
Post by: unikronsoftware 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.
Title: Re: Text Mesh optimization
Post by: RhapsodyGames on October 17, 2013, 04:38:02 pm
Thank You, second solution helps me :)