I have a project which involves pixel-art style 2d sprites inhabiting a 3d world. Up until now, I’ve solved the point filter blinky/jaggedness issue by resizing the sprites 4x in photoshop, and then setting the Import Texture Filter Mode to ‘Bilinear’ in Unity. Works like a charm!! But has caused another issue entirely: Memory/Storage.
A 1024x1024 sprite sheet sized up 4x becomes a whopping 21mb FULLY compressed. Considering the scale of the game, that’s going to become HUGE in file size, not to mention texture memory usage at runtime.
Here are some (long shot) options that came to mind. If anyone has new ideas on how to approach this, or ways to actually accomplish the methods below please let me know! Google has not been kind to me on this topic
Resize sprites during runtime. (Tried this, and it does work… but doesn’t reduce texture memory - actually worse since you can’t resize compressed textures. Not to mention figuring out the equivalent set pixelsPerUnit during runtime… bleh)
Write a custom bilinear shader. Seems to be the most promising option. I’m no expert in CG though, and I have a feeling it would really bog down GPU having hundreds of sprites on screen. Opinions welcomed.
Scaling sprites 2x instead of 4x.. No good, too blurry
Create a custom FilterType class (IDEAL). In theory, I only need bilinear to scale itself up 4x. However, I have zero idea if Unity even allows access to the current bilinear texture import setting function. Something like having a “Bilinear Scale” variable would be AMAZINGGGG for this.
There MUST be a way to kill these jaggies without using massive amounts of GB and TexMemory.
Went with the shader option. Wrote a very basic sprite shader that mimics smoothness of Bilinear by blurring. Handles all light situations (boy that was a pain to figure out how to not get white outlines in the dark w/ a point light). It also does shadows!
Fairly new to shaders, so I’m unsure of how efficient this is, but it completely solves my issue.