Search code examples
androidunity-game-engineshaderspriteassetbundle

Unity3D asset bundle sprites/default shader issue


I've updated my unity from 5.5.2f1 to 5.5.5p2, after building my first build, all of the assets containing sprite renderers where the shader is "sprites/default" downloaded from the cloud (which were working perfectly on builds from earlier version) are looking weird as hell - either they are smeared, duplicated, transparent and more weird anomalies that I honestly can't explain... I narrowed it down to being an issue only with the assets downloaded from bundles (as the ones that come with the basic app are working perfectly) and only on Android and Amazon (IOS seems to be ok). I've tried creating all the bundles from scratch through the new unity version assuming it might be some sort of a missmatch between the build version and the version the bundles were built in, but it did not help... adding some images to show the issue:

when downloaded from bundle (the background which is now red for some reason is downloaded, and the transparent overlay screen is downloaded) when downloaded from bundle (the background which is now red for some reason is downloaded, and the transparent overlay screen is downloaded)

how it should actually look, and how it looks when not downloaded from bundle. how it should actually look, and how it looks when not downloaded from bundle.

I will also go ahead and add that the images being distorted are images using the default unity sprites/default shader, furthermore, the symbols on the board along with the green dragon heads are actually showing fine even though being downloaded as well but they are using a different custom shader. This happens on every Android/Amazon device I've tested it on since I updated my Unity. Anyone has any idea what can cause such weird behavior?


Solution

  • So this answer is not a solid one but it did solve my problem as I couldn't for the life of me figure out whats causing this. In order to fix it I've upgraded Unity to version 5.6.4p3 and re-uploaded all the bundles to the cloud. The only Automatic change that was made to my project upon the upgrade was all the shaders had one of the lines changed:
    this line:
    o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
    changed into this line:
    o.pos = UnityObjectToClipPos (v.vertex);

    for some reason that did the trick and I honestly have almost zero knowledge in shaders which makes my ability to answer the question what caused this none-existent.