Unity ques: Hi res sprite sheet swapping for retina devices?
Hey, does anybody have experience using multiple resolution sprite sheets for mobile devices using unity's built-in 2D/new GUI stuff?
I know things like NGUI had (shitty) strategies for this, but ideally I'm looking for a native solution. So far the best I can find is that we have to do this manually, which seems not great for many reasons which I listed in this thread:
http://forum.unity3d.com/threads/working-multi-resolution-sprite-sheets.274683/
Any body has experience it would be appreciated ;)
I know things like NGUI had (shitty) strategies for this, but ideally I'm looking for a native solution. So far the best I can find is that we have to do this manually, which seems not great for many reasons which I listed in this thread:
http://forum.unity3d.com/threads/working-multi-resolution-sprite-sheets.274683/
Any body has experience it would be appreciated ;)
Comments
Unfortunately, Unity always has the entire mipmap chain in memory (that's how textures work), and the GPU will decide what mip level(s) will be chosen for sampling based on "things".
You can also only control the mipmap bias through shaders in Unity unless you happen to be running the FFP, which I guess Peter *could* be doing, but not if he's targeting mobile at all?
But yeah, having the bias set as a global shader values based on resolution at startup, and writing all of your own custom shaders for textures that you wish to dynamically change the resolution of could be a pretty neat trick in and of itself, but you'll still be sucking up all of that massive extra RAM on low-end devices just to store the 'retina' sized image data that isn't necessary, not to mention having to write and maintain a bunch of your own custom shaders
Also this video was linked by one the Unity devs. It's super useful if ever you've argued with 2D issues in Unity like how to do HD/SD texture swapping, Setting the size of the camera, getting pixel perfect sprites etc...