Author Topic: Bitmap font around 3x better performance than SPF?  (Read 3560 times)

PercyPea

  • Newbie
  • *
  • Posts: 16
Re: Bitmap font around 3x better performance than SPF?
« Reply #15 on: July 01, 2016, 04:37:33 AM »
mmm, not quite sure what's going on. I created a new font asset with 512x512 texture, instead of the 1024x1024 version.

Its giving no performance increase! still 22fps with the modified shader for an SPF with outline:(

My guess is the reason there is no performance increase, is because with the 1024x1024 texture. The S1 version isn't actually using that, but one of the lower mipmap levels, for example maybe the one at 256x256?

As the new font will also then use the 256x256 mipmap version, there is no difference in performance?

Sadly i'm about to be fired for spending to long trying to optimise the game I'm working on, so I think i'll stick with TMP bitmap with baked outline (and in the real game i also have baked drop shadow).


p.s. Sorry that I keep typing SPF instead of SDF :)

Certainly I personally can't get SPF with dynamic outline and underlay to get close :)

Maybe there may be more time for me to revisit in the future, but thanks very much for your help and quick responses. Ultimately TMP is still the best option, just not SPF for me :)

PercyPea

  • Newbie
  • *
  • Posts: 16
Re: Bitmap font around 3x better performance than SPF?
« Reply #16 on: July 01, 2016, 04:38:35 AM »
With regards to batching, in the  editor Stats panel always says it's just 2 draw/set pass calls, so i'm assuming it's fine. (Saved by batching 199, which is correct with 200 objects)

PercyPea

  • Newbie
  • *
  • Posts: 16
Re: Bitmap font around 3x better performance than SPF?
« Reply #17 on: July 01, 2016, 04:42:59 AM »
Just incase you want to check out my last test to confirm that I am using the right shader, it's here :-



The prefab 'TMP_SPF_Outline' is the one with the optimised shader and 512x512 texture

The 'TMP_SPF_Untouched' prefab is slightly 'touched' now to include outline just as comparison (this uses the non modified shader, and still a 1024x1024 texture)

Thanks
« Last Edit: July 01, 2016, 05:01:25 AM by Stephan B. »

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5631
Re: Bitmap font around 3x better performance than SPF?
« Reply #18 on: July 01, 2016, 04:58:39 AM »
I guess given the low resolution of that device, try an SDF Font Asset that is 256 X 256, the quality will be too low but I am curious to see if you'll see performance improvements.

I think on newer devices, like the Galaxy Tab 4 which is still pretty old, the performance gap is negligible where the benefits of using SDF Font Assets with the ability to use Material Presets out weights the performance delta. In addition, these tests are done with over 100 text objects on screen which might not be realistic either.

Ideally, the performance should be measure based on the game itself.

I'll try to get my hands on a Galaxy S1 (if I can find one) to see if I get similar results.

P.S. I downloaded the latest zip file you provided but also removed the link from the post since that essentially give everyone access to TextMesh Pro without buying it. Please make sure you take down those links on your end. If you upload and attach the zip files on the forum then only registered members are able to see those. Alternatively, you can always email me the files.
« Last Edit: July 01, 2016, 05:06:08 AM by Stephan B. »

PercyPea

  • Newbie
  • *
  • Posts: 16
Re: Bitmap font around 3x better performance than SPF?
« Reply #19 on: July 01, 2016, 06:01:20 AM »
Ah apologies, I completely hadn't thought about the fact they had TMP in. Have removed both zips from my FTP.

I'm not going to get a chance to test the lower res SDF today but will try and remember to soon. I'm currently fighting with Unity as there seems to be a bug with using ETC1 + Alpha sprites, packed with sprite packer, then made into an asset bundle. The bug is that in the core project, which uses those sprites from the asset bundle, the Alpha channels won't work. Completely unrelated of course to TMP :)