2D Toolkit Forum

2D Toolkit => Support => Topic started by: coolTool on August 14, 2012, 09:44:45 pm

Title: some 2dTextMesh and batching
Post by: coolTool on August 14, 2012, 09:44:45 pm
hi
in scene show 1 drawcall (3 batched)
in game show 3 drawcall (1 batched)
screenshots:

ps (unity 3,5,0).
Title: Re: some 2dTextMesh and batching
Post by: unikronsoftware on August 15, 2012, 12:02:17 am
I can't tell from the screenshot - what platform is the build target?

Edit: You should get perfect batching on all platforms apart from flash, since Unity don't support dynamic batching on it yet (the Flash export isn't final in 3.5.x). There are a few criteria for dynamic batching - if you meet all of them, then the batches should work. What is the MaxChars on those textmeshes?
Title: Re: some 2dTextMesh and batching
Post by: coolTool on August 15, 2012, 12:38:47 am
target platform is android
 MaxChars is 16


update Unity3d to 3,5,5
Title: Re: some 2dTextMesh and batching
Post by: unikronsoftware on August 15, 2012, 01:10:10 am
All of them have the same transform.localScale?

This is weird, shouldnt happen. Can you send a repro to support@unikronsoftware.com?
Title: Re: some 2dTextMesh and batching
Post by: coolTool on August 15, 2012, 01:21:08 am
localScale:                    x   y   z
1 textMesh         0.5  0.5  1
2 textMesh         0.5  0.5  1
3 textMesh         0.5  0.5  1

set localScale  to
scale:                    x   y   z
1 textMesh         0.5  0.5  0.5
2 textMesh         0.5  0.5  0.5
3 textMesh         0.5  0.5  0.5
and problem is solved
Title: Re: some 2dTextMesh and batching
Post by: unikronsoftware on August 15, 2012, 01:32:05 am
Cool. The unity dynamic batching rules are weird. Always prefer the text mesh / sprite scale over transform.localScale - that doesn't break batching.