- Home /
Disable Mipmaps on GameObject ( Fonts are Blurry )
Can I disable mipmaps on a meshrenderer during runtime?
At a near medium distance my fonts are blurry due to mipmapping (I'm using a font that replicates a 5x7 dot-matrix display). I've turned the size to upwards of 90... it gets nice and crisp up close, but if I pull the camera back at all the mipmapping mashes and blurs everything together. If I turn the font size way down it's not an issue at a distance.. but then up close it looks terrible.
I was hoping for something like "().mipmapEnabled = false;" however the only way I can make that work is if the texture is being imported.
I've tried using a bitmap as font so I can use the advanced setting to turn mipmapping off... our complicated system doesn't like bitmaps for fonts, it wants a .ttf. So I can't use that trick.
This is for Unity 4. I have both 4 and 5 pro. This project can only be used in 4. Maybe it's for complications that I'm not aware of... but I do not understand why there is so much trouble with turning mipmaps off for fonts. I think I'm missing some small detail...
Any help is greatly appreciated. I've scoured the web and input on this seems like it would help many others.
what I am going to tell you is not a good coding practice, but it could work until you find good solution. you can set bool mipmapsEnabled when you create texture at runtime. so basically you can re-create your texture and set mipmaps to false. Texture2D tex = new Texture2D (0, 0, TextureFormat.RGBA32, false); where 'false' stands for should this texture have mipmaps. ofcourse if you are running this frequently (e.g. in update) then it's not a performance friendly solution. however, this could be a dirty workaround you wouldn't tell anyone about.