- Home /
Sprite filtering: Point/Bilinear
I'm currently working on a pixel-art type of game (using Unity 4.3's new 2D feature), and I would really like the graphics to scale well so I can zoom around and do other crazy camera stuff.
If I set the Filter Mode on my sprite to Point, it scales up very nicely, but loses a lot of fidelity and looks outright broken when it starts to scale down. On the other hand, when I use Bilinear filtering, the sprite scales down nicely, but looks blurry when up close.
Here's a picture I made to illustrate (please excuse the programmer art):
My main question is this: is there any way to cause the sprite to change filter modes depending on how large it appears onscreen? (i.e. point at x2 scale and above, bilinear anywhere below that)
Alternatively, is there a better way to display pixel art?
Answer by iwaldrop · Dec 24, 2013 at 11:18 PM
You can set a texture's filter mode programatically.
See: Texture2D.filterMode for an example.
That'll work, thanks! Good to know I'm on the right track. I'll accept in a few days if nobody has a more elegant solution.