Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: johns on May 19, 2014, 12:08:46 AM
-
I'm trying to optimize the number of drawcalls using the drawcall tool.
The Panel itself has depth 0, and a few sprites within it also have a depth of 0. I expect all of them to get drawn at the same time however the drawcall tool shows that some of them are being batched and some of them are drawn separately. What is the reason and how can I make all of them get drawn at the same time?
Also I've noticed that widgets with different depth values are being grouped together. Is it the expected behaviour?
Thanks.
-
Sharing the same depth doesn't mean it will be batched. Only the same material can be batched. If you use different materials (different atlases, dynamic fonts, textures, etc), then they obviously can't be batched.
It's generally not a good idea to have widgets share depth unless you know they will never overlap.
-
Sharing the same depth doesn't mean it will be batched. Only the same material can be batched. If you use different materials (different atlases, dynamic fonts, textures, etc), then they obviously can't be batched.
It's generally not a good idea to have widgets share depth unless you know they will never overlap.
Actually, I have this issue even though the widgets share the same atlas. When I go over all the draw calls, there is sometimes one to much for the same atlas, and usually it's just one or two widgets causing the issue. If I adjust their depth, then suddenly it's only one drawcall...
Edit. Actually, I just noticed why (and of course it makes sense). It's when I have dynamic fonts rendered in-between widgets... :) Since that will require additional draw calls for them to sandwich correctly.
-
Yeah, same thing for me - getting rid of dynamic fonts solved the issue.