Support => NGUI 3 Support => Topic started by: laurentl on March 02, 2014, 08:25:18 PM
Title: Mipmap Dynamic Font? (2.7)
Post by: laurentl 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?
Title: Re: Mipmap Dynamic Font? (2.7)
Post by: ArenMook 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.
Title: Re: Mipmap Dynamic Font? (2.7)
Post by: laurentl 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)?
Title: Re: Mipmap Dynamic Font? (2.7)
Post by: ArenMook on March 02, 2014, 10:08:20 PM
NGUI uses RequestCharactersInTexture in a few places inside NGUIText.cs.
Title: Re: Mipmap Dynamic Font? (2.7)
Post by: laurentl 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?):
mDynamicFont.material.mainTexture.mipMapBias=.5f;
mDynamicFont.material.mainTexture.anisoLevel=2;
It doesn't make a difference no matter the value of mipMapBias, what do you recommend?
(http://)
Title: Re: Mipmap Dynamic Font? (2.7)
Post by: ArenMook 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.
Title: Re: Mipmap Dynamic Font? (2.7)
Post by: laurentl 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.