Author Topic: Benefits of Atlas Switching  (Read 2731 times)

yeahus

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 10
    • View Profile
Benefits of Atlas Switching
« on: August 24, 2014, 11:58:31 AM »
Aside from reduced memory usage, does having a smaller texture atlas offer any performance increases?

I'm currently optimising my game for iPhone 4, and up to this point I've just been scaling my UHD/SHD (i.e. iPad retina) GUI for different screen sizes. Will creating a lower res version of the GUI improve performance on the iPhone 4?

As an aside (and sorry for going off topic in my own thread!), is the 'Unlit/Premultiplied Colored' shader the best shader to use for performance?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Benefits of Atlas Switching
« Reply #1 on: August 24, 2014, 07:55:10 PM »
Yes. GPU sampling a smaller texture improves performance. Likely not a whole lot, but every bit helps.

Unlit/Premultiplied Colored is indeed the fastest, but the difference between it and Transparent Colored is not noticeable on all but the oldest of phones. I did some testing a while back for uGUI, and I had to overlay something like 20 full-screen widgets on top of each other in order to see the difference. Transparent Colored was at like 31 FPS to Premultiplied Colored 34 FPS.

beermoney

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 80
    • View Profile
Re: Benefits of Atlas Switching
« Reply #2 on: August 25, 2014, 06:43:11 AM »
I heard transparency on ios was a bad thing. Something along the lines of having to render the pixel behind the transparent one twice.

http://gamedev.stackexchange.com/questions/25929/ios-opengl-transparency-performance-issue

probably nothing to worry about if your targeting hardware newer than the iPhone4

yeahus

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: Benefits of Atlas Switching
« Reply #3 on: August 25, 2014, 02:35:31 PM »
Awesome, thanks very much!

alexsan99

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: Benefits of Atlas Switching
« Reply #4 on: August 07, 2015, 06:30:45 AM »
 Hi guys,
I'm not 100% sure if this is the right thread. There are several threads here and there about Multiresolution support, but still didn't help me, unfortunately..
I was trying diferent approaches to SD/HD Atlases switching in my game, but it didn't really worked as I expected.

I was wondering if I have, for instance, created two different NGUI sets - one for SD and another for HD, and simply enable/disable one of those via script, based on Device resolution (width or height) , will it have any impact on memory?
I have two Atlases: SD and HD, but not loading them from Resources. Two GUI sets just using corresponding Atlas, that's it.

I'd like to have crispy (Pixelperfect) GUI for SD and HD.


Also, is there any restrictions or recommendations regarding how many Atlases one can use in a game?
Appreciate any tips!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Benefits of Atlas Switching
« Reply #5 on: August 08, 2015, 11:36:18 PM »
It will most certainly have an impact on memory unless you don't just disable them, but dynamically load the prefabs into the scene via Resources.Load. Otherwise both will exist in your memory at the same time.