Unity ques: Hi res sprite sheet swapping for retina devices?


Notice: Undefined variable: GuestHourOffset in /home/nitrogen/public_html_mgsatest/forums/themes/mgsa/class.mgsathemehooks.php on line 281

Notice: Undefined variable: GuestHourOffset in /home/nitrogen/public_html_mgsatest/forums/themes/mgsa/class.mgsathemehooks.php on line 281
edited in Questions and Answers
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 ;)

Comments


  • Notice: Undefined variable: GuestHourOffset in /home/nitrogen/public_html_mgsatest/forums/themes/mgsa/class.mgsathemehooks.php on line 281
    So, weird idea, but it might work: Can you manually load different textures at the different mip levels and then move your camera back and forth (or change your mip bias) according to the resolution reported by the device? Unity should only load the textures at the correct mip resolution and voila, bob's your uncle.

  • Notice: Undefined variable: GuestHourOffset in /home/nitrogen/public_html_mgsatest/forums/themes/mgsa/class.mgsathemehooks.php on line 281
    My guess is that changing the camera Z wont make any difference on mipmap sampling as with an Orthographic projection, the Z doesn't affect the size of viewport, and hence the scale of the textures being rendered.

    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

  • Notice: Undefined variable: GuestHourOffset in /home/nitrogen/public_html_mgsatest/forums/themes/mgsa/class.mgsathemehooks.php on line 281
    Ah. I'm mostly suggesting it because we had some really weird shit going on with mipmaps in DD (which is orthographic) based on camera distance to objects and specific build settings on different machines. Very annoying to diagnose... It probably wouldn't be an effective solution though :(

  • Notice: Undefined variable: GuestHourOffset in /home/nitrogen/public_html_mgsatest/forums/themes/mgsa/class.mgsathemehooks.php on line 281

    Notice: Undefined variable: GuestHourOffset in /home/nitrogen/public_html_mgsatest/forums/themes/mgsa/class.mgsathemehooks.php on line 281
    edited
    So for those interested I seem to have arrived at the most official solution, which is to load assets from the Resources folder using string references. It's not perfect but it works. Thanks to all the guys that helped out with suggestions both online and offline. If you want more detail I updated the Unity thread: http://forum.unity3d.com/threads/working-multi-resolution-sprite-sheets.274683/#post-1816605

    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...
Sign In or Register to comment.

Debug Trace

Info Need to re-index theme cache
Info Need to re-index plugin cache
Info CommentModel->PageWhere()
Info
Comment.Page.30.2521.1: false
Info CommentModel->CachePageWhere()
Info
Comment.Page.30.2521.1: array (
  0 => '2014-10-20 15:29:28',
)
Notice Undefined variable: GuestHourOffset
/home/nitrogen/public_html_mgsatest/forums/themes/mgsa/class.mgsathemehooks.php line 281.
/home/nitrogen/public_html_mgsatest/forums/library/core/class.format.php line 465.
/home/nitrogen/public_html_mgsatest/forums/themes/mgsa/views/discussion/discussion.php line 62.
/home/nitrogen/public_html_mgsatest/forums/themes/mgsa/views/discussion/index.php line 35.
Notice Undefined variable: GuestHourOffset
/home/nitrogen/public_html_mgsatest/forums/themes/mgsa/class.mgsathemehooks.php line 281.
/home/nitrogen/public_html_mgsatest/forums/library/core/class.format.php line 465.
/home/nitrogen/public_html_mgsatest/forums/library/core/functions.render.php line 338.
/home/nitrogen/public_html_mgsatest/forums/themes/mgsa/views/discussion/discussion.php line 66.
Notice Undefined variable: GuestHourOffset
/home/nitrogen/public_html_mgsatest/forums/themes/mgsa/class.mgsathemehooks.php line 281.
/home/nitrogen/public_html_mgsatest/forums/library/core/class.format.php line 465.
/home/nitrogen/public_html_mgsatest/forums/themes/mgsa/class.mgsathemehooks.php line 712.
/home/nitrogen/public_html_mgsatest/forums/applications/vanilla/views/discussion/comments.php line 19.
Notice Undefined variable: GuestHourOffset
/home/nitrogen/public_html_mgsatest/forums/themes/mgsa/class.mgsathemehooks.php line 281.
/home/nitrogen/public_html_mgsatest/forums/library/core/class.format.php line 465.
/home/nitrogen/public_html_mgsatest/forums/themes/mgsa/class.mgsathemehooks.php line 712.
/home/nitrogen/public_html_mgsatest/forums/applications/vanilla/views/discussion/comments.php line 19.
Notice Undefined variable: GuestHourOffset
/home/nitrogen/public_html_mgsatest/forums/themes/mgsa/class.mgsathemehooks.php line 281.
/home/nitrogen/public_html_mgsatest/forums/library/core/class.format.php line 465.
/home/nitrogen/public_html_mgsatest/forums/themes/mgsa/class.mgsathemehooks.php line 712.
/home/nitrogen/public_html_mgsatest/forums/applications/vanilla/views/discussion/comments.php line 19.
Notice Undefined variable: GuestHourOffset
/home/nitrogen/public_html_mgsatest/forums/themes/mgsa/class.mgsathemehooks.php line 281.
/home/nitrogen/public_html_mgsatest/forums/library/core/class.format.php line 465.
/home/nitrogen/public_html_mgsatest/forums/themes/mgsa/class.mgsathemehooks.php line 712.
/home/nitrogen/public_html_mgsatest/forums/applications/vanilla/views/discussion/comments.php line 19.
Notice Undefined variable: GuestHourOffset
/home/nitrogen/public_html_mgsatest/forums/themes/mgsa/class.mgsathemehooks.php line 281.
/home/nitrogen/public_html_mgsatest/forums/library/core/class.format.php line 465.
/home/nitrogen/public_html_mgsatest/forums/library/core/functions.render.php line 338.
/home/nitrogen/public_html_mgsatest/forums/themes/mgsa/class.mgsathemehooks.php line 715.