Raw Image: Rare White Textures

Hello Everyone :slight_smile:

I am about to release my app for iOS and Android, but there is an issue I have only just spotted that is quite serious and needs to be fixed.

I am downloading images from my server and applying them as a texture to Raw Image. All of the images downloaded from the server have almost exactly the same dimensions, and in most cases, they are applied correctly. However, some of the time, a texture will appear as completely white, even though the download completed ok. If I exit the user interface (where the Raw Image is), re-download the photos, and open the UI again, it will appear correctly most of the time.

This problem seems to appear on mobile builds. One thing I have noticed in the past, is that if I sequentially apply different textures of different dimensions to a single Raw Image, then any texture will appear as white if its dimensions are significantly different to the first texture applied. Currently, I am only applying one texture to a Raw Image that has an empty texture initially, but I don’t know if these observations might be related.

Has anyone had any similar problems to this? It is strange that the bug only happens some of the time, and it is very difficult to understand under what conditions it happens. I would be very happy for any help offered!

Best wishes,
Nat :smile:

I think I have discovered what might be causing this behaviour, and it is my use of Resources.UnloadUnusedAssets();
After removing all “Resources.UnloadUnusedAssets();” from my code , the random white textures seem to have stopped. However, I now have lots of memory piling up, and I am back to the old problem of releasing texture memory. I have read many forums about this and have tried things like scaling down textures, using Destroy(tex) and setting textures equal to null, but only Resources.UnloadUnusedAssets() seems do actually do anything on mobile devices.

same problem here, did you find any solution for the memory ?