Black Sprites sometimes when running.

Hi,

I’ve made a 2D game for android but I’m finding that sometimes when I run the app and some of my sprites will be black. I’m testing on 3 different android phones and one tablet and the issue is sporadic but has been seen on all of them. I’m also running google Admobs within the game for advertising and even they show up as black.

I use a total of 6 sprite sheets, all set to exactly 1024x1024 and the total file size of my sprites folder is 1.77MB. I have texture compression set to ETC1 or RGBA16 on my build settings and building for android 2.3.1 and the issue really is sporadic. I am using no custom shaders, purely Unity’s defaults and have also tried disabling the 32 bit display buffer but still no luck.

Sometimes the game will load absolutely fine and other times it loads with the majority of my sprites black and I’m really lost for why this is happening. I’ve added a screenshot with this too in the hopes that somebody can shed some light on this issue.

Thanks in advance for any help.

Anybody have any ideas please? I’m really at a loss and this is the only thing holding me back from release.

Hi WinterSoldier5,
I am facing the same exact problem here. One day, for no reason, some sprites started to appear as black shapes.

This is not happening all the time with all the textures, but sometimes ones are black, other times I get different ones and so on.

Did you manage to find a fix? If so, how did you do it? If not, we can try to find a solution together.

My textures are 2048 and this should be fine (I am building for Android)

Kind Regards

Hi Llufes,

Unfortunately I am yet to find a fix for this, however, as you say we may find a solution together and so I’ll give you as much information as I can. So the most important information I’ve found is from the logcat from Adb. I ran the game multiple times and tried to repeat the issue, I found that when the issue is missing the following line is present in the logcat which looks rather ominous.

E/Unity (23092): GLSL compilation failed, no infolog provided

So here’s also what I’ve tried without fixing it:

Disable Anti Aliasing
Using ETC1 / RGBA16 Compression
Making Textures smaller than 1024x1024
Recreating the project from scratch
Upgrading to the latest version of Unity
Set quality settings to fastest
Disabled 32 bit buffer
Disabled Mipmaps for sprites

None of these have solved the issue and it has got to the point now where I had to submit a bug report through Unity as I just don’t know the answer.

Hopefully you have better luck than I do.

Hi again WinterSoldier5,

Tonight I will work on it, I will try to change everything that could be affecting it. It is interesting though that a friend of mine could run the project on another device, different from mine without the black sprites.

We stay in touch.

Be aware this may not be quite as you think. The issue for me is very random and will appear fine most of the time and then just one or two times it isn’t. I’m testing on 3 different devices myself and have seen it on all of them at some point with varying levels of how common it is.

Hi

Can you provide us with

  1. The specs or model of the devices you are testing your game on?
  2. A sample project to help us reproduce this problem (via bug reporter)

We will take a look at our end to see what might be the problem.

Cheers

Hi leoyaik,

I submitted a bug report including Adb logcat print outs, screenshots and my project folder. The bug report can be found here.

The devices I’m testing on and their specs are:

HTC One
Samsung Galaxy S3 Mini
Sony Xperia SP
Samsung Galaxy Note 10.1 2014 Edition

Thanks for any help you can provide.

@WinterSoldier5 I am moving this thread to the Graphics forum to get more views on it.

Any solution for this issue ?
Some of my RGBA 16 bit sprites and TextMeshes are facing this issue.

In SOME cases this can be due to certain phones not being able to process NPOT (not power of two) textures. In other words, textures that have certain odd pixel dimensions. Specifically the safest (but not practical) thing to do is to make sure that all of your sprites are a POT (power of two), such as 8px by 8px, 32px by 128px, etc. It’s ok to increase transparent space around a PNG in order to achieve the nearest POT value. For example if you have a sprite that is 100px by 400px, just add extra transparent space around it so that the final PNG is 128px by 512px.