Author Topic: Atlas only shows white boxes on Android Tablet  (Read 5210 times)

Cales

  • Guest
Atlas only shows white boxes on Android Tablet
« on: December 21, 2012, 10:56:37 AM »
Hi,

everything worked fine with NGUI for a long time (we made an entire game using it), but now I encountered a problem and becoming desperate about it:
When I made an .apk and installed it to a Samsung Tab there are only white boxes shown and not the graphics from the atlas. On every other Android device it works fine, graphics are visible on Sony and Samsung smartphones, PC version works great.

I already tried several things that didn't help:
- changing the atlas shader from Unlit/Transparent Colored to many others (no effect)
- changing the compression rate (no effect)
- changed the graphic level to OpenGL 2.0 (the sprites turn completely black)
- changed the texture type from GUI to Texture and Advanced (no effect)

I added another test plane and new texture that was shown correctly. So it has something to to with the atlas.
I attached a photo from the tablet & game.

I'm happy for every idea / suggestion!

Best regards,
Michael

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Atlas only shows white boxes on Android Tablet
« Reply #1 on: December 22, 2012, 04:02:07 AM »
It looks like your device doesn't support shaders? Do you have your UI in a clipped panel?

Cales

  • Guest
Re: Atlas only shows white boxes on Android Tablet
« Reply #2 on: December 22, 2012, 05:37:16 AM »
It's the Samsung Galaxy Tab 2, as far as I know it does support shader.
The UIPanel clipping is set to none. Could this be the problem?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Atlas only shows white boxes on Android Tablet
« Reply #3 on: December 22, 2012, 07:39:26 AM »
Nah. I had a samsung tab 2 about 6 months ago and NGUI ran fine on it (although it was quite slow compared to my Asus Infinity tab).

Cales

  • Guest
Re: Atlas only shows white boxes on Android Tablet
« Reply #4 on: December 22, 2012, 08:19:08 AM »
Yes, I thought so, too. An other project having several shaders also works fine on it.
I tried to add clipping to the Panel script, but the problem stays the same. Changing to some other shaders makes the text look like white boxes in the editor but not all of the graphics (what it anyway does on the tab).

I added a picture how it should look like and how it's displayed on smartphones and PC. I just can't figure out why it's not working on that tablet.  :-\
Every sprite uses a reference atlas and all references actually go to the same atlas with a size of 4096x4096.

Do you have any other ideas?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Atlas only shows white boxes on Android Tablet
« Reply #5 on: December 23, 2012, 06:40:24 AM »
When something weird like that happens, try walking backwards and removing things you've done until you narrow it down to just 1 sprite, then make the same layout from scratch in a new scene in a new project and see if that works. Without using clipping, the shaders are not even used, so even non-shader supporting devices like iPhone 1 will show the UI properly.

Cales

  • Guest
Re: Atlas only shows white boxes on Android Tablet
« Reply #6 on: December 23, 2012, 07:01:11 AM »
Well, good to know and weird indeed.
I keep trying finding the root of this error. Thanks for your answers!

DackAttack

  • Guest
Re: Atlas only shows white boxes on Android Tablet
« Reply #7 on: January 16, 2013, 04:54:49 PM »
I am running across this issue now with the Galaxy tablet. You mentioned in a later post that you are using an Atlas reference, which is the issue I am running into: all sprites from a normal atlas are fine, but all sprites from a reference atlas do not show up. This issue seems to only happen on this tablet so far, and has not been an issue for any iOS device or any other Android device.
Were you able to find any way to fix the issue?

Cales

  • Guest
Re: Atlas only shows white boxes on Android Tablet
« Reply #8 on: January 17, 2013, 04:24:21 AM »
Yes, I was. :)

The solution was simpler than I thought:
I tried several atlas sizes - some were displayed and some were only white. 2048x2048 and smaller textures were displayed without any error. So I had to change the sprite and atlas layout for the game (what took some time). Any atlas larger (e.g. 2048x4096 or 4096x4096) was displayed as white.

I have no idea why smartphones can display large atlas textures and tablets can not, but now it works properly.
Hope this also works for you, DackAttack!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Atlas only shows white boxes on Android Tablet
« Reply #9 on: January 17, 2013, 09:39:01 PM »
4096x4096 texture sizes are only supported on the very latest mobile devices. By default, the limit is 2048x2048.

DackAttack

  • Guest
Re: Atlas only shows white boxes on Android Tablet
« Reply #10 on: February 01, 2013, 09:05:36 AM »
This was my issue as well, thanks for the responses!