Graphics corruption on Android
Hi, I'm developing a simple game and when I play it on some devices it shows like this:
In most devices it runs properly. If I active Multithread rendering it solve the problem but the Canvas' menu doesn't appear. What can I do?
Answer by Lord Emperor · Oct 18, 2015 at 08:32 PM
Try setting your Clear Flags to Solid Color on your camera. I had it on Don't Clear and got a similar problems on Android (it must not init the camera buffers properly without it).
I was struggling with this error in an important project for some days. It's a tricky problem because with a lot of scenes, and only this one with the problem, we start to think it's something about specific codes and mechanics, not a default camera in the scene. Turn's out this specific camera, different from the whole project, was with the "Don't Clear" param set.
Thank you both for the thread and the answer!
Answer by tuinal · Feb 17, 2017 at 02:53 PM
Bit late for an answer here but at this is the first hit for this type of problem via Google;
I found corruption issues were solved without losing functionality by putting my "depth only" camera to "solid colour" in the editor and attaching a script with GetComponent ().clearFlags = CameraClearFlags.Depth; in the Start() method.
I think as mentioned above it's something to do with how the camera initialises. It seems any Camera set initially as Depth or Don't Clear on Android can have corruption issues (which vary between device), but it's possible to 'initialise' them as Solid Colour and then switch them immediately to Depth/Don't clear to (hopefully) avoid the corruption issue.
Answer by JamToak · Sep 26, 2015 at 09:04 PM
Does your camera fill the whole screen ? Because if you don't have a scene camera (must fill 100% of the screen -- black boarder on the right ?! --> set the viewport rect X:0, Y:0, W:1, H:1) such artifacts can occur. If that's not the case -- I have no clue ;)
Okay, I set the viewport rect as you said but it still happens. It's frustrating.
That's weird and Im sorry to hear that. I'm hoping for you, that somebody else knows the answer to your question.