Author Topic: Mipmap Dynamic Font? (2.7)  (Read 12593 times)

laurentl

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 188
    • View Profile
    • McDROID
Mipmap Dynamic Font? (2.7)
« on: March 02, 2014, 08:25:18 PM »
I want text to blur when small, like mipmap, instead of staying crisp but losing definition.
How do I do that?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Mipmap Dynamic Font? (2.7)
« Reply #1 on: March 02, 2014, 09:58:37 PM »
I don't think it's possible with dynamic fonts as you have no control over the texture settings. You can try modifying it by enabling mipmaps on it, but chances are Unity will just overwrite it for you next time the texture is changed.

laurentl

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 188
    • View Profile
    • McDROID
Re: Mipmap Dynamic Font? (2.7)
« Reply #2 on: March 02, 2014, 10:01:52 PM »
That's what it seems.
I'm not familiar with the asset pipeline, is the texture changed by RequestCharactersInTexture at the end of public void Request (string text)?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Mipmap Dynamic Font? (2.7)
« Reply #3 on: March 02, 2014, 10:08:20 PM »
NGUI uses RequestCharactersInTexture in a few places inside NGUIText.cs.

laurentl

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 188
    • View Profile
    • McDROID
Re: Mipmap Dynamic Font? (2.7)
« Reply #4 on: March 03, 2014, 07:27:22 PM »
I found them and added this after each one of them except after the one querrying 'j' (why j?):
  1. mDynamicFont.material.mainTexture.mipMapBias = .5f;
  2. mDynamicFont.material.mainTexture.anisoLevel = 2;
  3.  

It doesn't make a difference no matter the value of mipMapBias, what do you recommend?


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Mipmap Dynamic Font? (2.7)
« Reply #5 on: March 03, 2014, 09:44:53 PM »
That text in your screenshot makes no sense. Whoever is doing your translations doesn't know what the hell they're doing. :P

It's 'j' because it extends below the baseline, letting me establish the lowest point.

Mipmap bias isn't it. I just had a second look and it doesn't seem Unity exposes a way to turn on mip-mapping after the texture has been created. It only seems to be an option at the creation time. You can try using tex.Resize() though, it has a way to turn on mip-mapping, but I don't know what effect this will have.

laurentl

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 188
    • View Profile
    • McDROID
Re: Mipmap Dynamic Font? (2.7)
« Reply #6 on: March 05, 2014, 02:50:09 PM »
Google Translate always knows how to make us laugh  ;)

I replaced those with tex.Resize() and now I get a "Texture is not readable.", I think RequestCharactersInTexture makes read only textures so I logged a bug with UT.