One of our QA testers has started having some problems intermittently on his iPhone 5 with textures not loading, and a solid color being displayed instead. Note that the solid color is not a color we specified in the game, it appears to be an “average of all colors” in the texture that unity is displaying in lieu of the full texture.
I too have an iPhone 5 but cannot replicate this.
This seems to have started after we upgraded to 4.2… Please see the attached screenshot from his iPhone 5, and then a screenshot from the editor just to demonstrate how it should be (full textures on the ground, background walls etc)
Really hard to say without having the project folder and the hardware and a repro case.
Totally wild guess: in some quality setting the textures are setup to drop largest mip levels, and so you end up with much more blurry versions (“averaged”) of them? Do you have any scripts changing the quality levels at runtime?
Another wild guess: running out of memory, and Unity starts dropping mipmap levels (in order to avoid crashing)?
Thanks. I am indeed setting quality levels at runtime based on the device (iPhone 5 gets a better quality than say, iPad 1, for instance) … is there anything that happens when you set them at runtime versus just the default build settings that you think could cause this?
This user is also experiencing occasional crashes I cannot reproduce so your mipmap dropping theory may make some sense.
I have the same problems on iPad3 since we upgraded to 4.2.1 from 4.1.5 recently. It seems like some textures are not loaded into VRAM, which were displayed by solid color, but the problems have never happened in 4.1.5.
However, in our game we can manually enable/disable real-time shadow by setting quality levels. When the problems happened (under the real-time shadow enabled), we disabled real-time shadow, the texture displayed perfectly. It is weird.
As i said, the problems happened randomly, sometimes on Texture A, sometimes on Texture B.
That’s very interesting, as we disabled realtime shadows for other reasons recently, and have not experienced the issue since then. You could be onto something.
And we always ran realtime shadows in production without ever hearing of this issue on earlier 4.x versions.
I confirm this is not a memory problem. See the attached screenshots. The first one was captured under realtime shadow disabled, then i switched the
Quality Setting level to enable realtime shadow, the bomb looked fine.
How does Unity drop some textures mip level to a solid color randomly?
We’ve just started seeing this issue randomly occur in the last week or two. Our QualitySettings have RealtimeShadows enabled, however, we do not use them. I’m running some tests with them off to see if there is any difference.
I suspected memory issues at first because it happened first on a memory constrained device (iPad Mini) but now we’ve seen it on devices that aren’t under memory pressure at all (iPad4.) In our case when it happens scene-wide it will affect all meshes in the scene using the same shader. What shader is affected is random (sometimes it was our character shader, sometimes it was our non-alpha env shader, sometimes it was building shader, etc.) but the end result is the same.
I’ve seen one bug like this but this is no longer repro with dev version. it was also about switching shadows on/off.
My point is - if you can create smallish repro - bug report: i will be happy to look at it
We’ve also seen this issue while testing both on Android and iOS devices. I was also suspecting memory issues and in our project this is also happening scene-wide and affecting all meshes with the same shader. We even had this issue in with the NGUI system, rendering the whole UI in black. One thing I’m quite sure about is that the problem only occurs with our own custom shaders. Also our build settings have realtime shadows off, so that is not causing the problem with us. I have the feeling the bugs were occurring less when we started to optimize the memory-footprint of our app. My guts tell me to try and turn off mip mapping for the textures that seem to have the issue, but I am not sure this is the solution to the problem.
Has anyone found a workaround and/or filed a bug report to Unity? Our project has a size of around 1Gb at the moment, so it is quite big to be able to send it in for a bug report. We’re about to release the game, so I’m quite stressed about this problem.
Thanks Alexey. I’ve reproduced the issue in a really really small narrow slice of our game and submitted a bug report. It’s basically just a fixed scene with our shaders and settings, a bit of our geo and textures, and a script to repeatedly reload the level.
It happens, anecdotally, one in twenty scene reloads. So please be patient with the example!
And here I thought we were the only ones experiencing this. A while back we were getting this issue with one of the larger textures in our game (only on devices). As previously surmised, it appears to only happen with custom shaders.
As far as we could tell, visually, the texture wasn’t so much mipping down, but rather had completely hosed UVs (looked identical to scaling the UVs by about 0.001). We managed to get around that one by changing the way we loaded the asset (instead of keeping it in the scene, we instantiated it at load time), but I’m starting to see it happening with random particle effects now as well (and these are instantiated at run time). We’re not using realtime shadows (2D isometric game, and shadows are disabled in the quality settings).
Similarly to andy_hnc, this is intermittent, but reproducible. Also not a memory issue, at least as far as we can tell, since it happens on both high end iDevices and low.
found this today, which I’m hoping will work. I’ve dropped all our custom shaders into the array/list in the GraphicsSettings manager, and keeping my fingers crossed. Will update if it appears to have fixed things.
[/edit]