Scrambled textures on first run of game only.

Hi there.

I’m having this problem where in the desktop build of the product we’re developing, the diffuse textures of a lot of the objects will have what seems to be the lightmap textures for the level applied to them. You can find a screenshot below.

This is what it is supposed to look like, and looks like on each subsequent launch

The tricky thing is, this only every happens on the very first run of the application on a fresh PC or User account. For example, i can go to a fresh PC, launch the .exe, the textures will be scrambled (this persists between scene loads,) then I close the game and reopen it, and everything is as it should be. From then forward the textures are always perfect.

I have tried to clear as much cache data from .appdata relating to the game as I can find to try and reproduce this issue, but so far havn’t found any other reproduction method other than making a new user account/going to a new PC.

I’ve tried Preloading shaders/preloading assets, innumerable different build settings, rebaking all the lightmaps, just everything I can think of. I’m stumped to be honest.

Interestingly, if I change the graphics order to start in DX9 instead of DX11 by default, the game will crash on first run rather than showing garbled textures. Still fine on each subsequent run though.

You can imagine how much a pain to test this is, so any help will be appreciated.

If anyone comes across this, my issue was solved with a FULL rebake (delete all lightmaps, remove the library file, reopen unity, hit the bake button, wait 10-thousand years.)

I know it’s not the best solution as to WHY this was happening, but it did work, although I swear I’d done that before…

Thanks for sharing, no doubt word mystery solving is a big game that can strengthen your brain a lot. Specially, when you are working hard on this. And tangled in a situation then unscrambles will help you to git rid of this situation.