Author Topic: Large semi-transparent sprites on iOS - Suggested texture settings?  (Read 3541 times)

electrodruid

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 48
    • View Profile
The HUD design for the iOS game I'm working on calls for a couple of big rotating semicircles/crescents, which form two parts of a ring that's almost the width of the screen. Surprise, surprise: it's killing the fill-rate. The first pass was an actual big semicircle texture, which was really bad. The next pass was to make a texture that was a curve representing about 1/6th of a circle, and to re-use that a few times at different angles. That's better, but I'm still drawing a lot of transparent stuff over the top of the scene and the framerate is still suffering as a result.

The texture atlas for the game UI primarily uses just white textures with an alpha channel, which are coloured when they're drawn as sprites. There are some multicoloured icons on there but I could easily move those off to another atlas. The question is, is there anything I could do with the texture settings and/or shader for this atlas which might improve performance? An obvious thing to try would be to somehow make the texture be some kind of alpha-only format. I tried turning on "Override for iPhone" and changing the format to "Alpha 8" but that makes all of the sprites black, and I couldn't find a shader in the drop-down menus on the material which worked with that.

Any other suggestions? Is any of the PVRT stuff beneficial to iOS performance without sacrificing image quality? Will it help just to reduce the texture size of the offending sprites on the atlas but stretching them to the same size? I'm not terribly experience in optimising textures for iOS, particularly through Unity, so any advice would be welcome.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Large semi-transparent sprites on iOS - Suggested texture settings?
« Reply #1 on: June 13, 2013, 04:10:02 AM »
None of that is going to help with fillrate. The only way to save fillrate is to ensure that you write to each pixel as little as possible.

Play Starlink for example and look at the background (easier if you have the Starlink UI kit since you can just select it). That background is composed of 3 textures blended together -- the stars, and two nebulas -- and yet each pixel is written to only once. I did that by creating a custom shader that simply reads 3 textures and mixes them together. You have to do something similar.

P.S. Also try using Unlit/Premultiplied Colored shader. It can be cheaper on some devices (older ones especially).