Search Unity

  1. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  2. Unity 2017.2 is now released.
    Dismiss Notice
  3. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  6. Unity 2017.3 beta is now available for download.
    Dismiss Notice

Shaders and asset bundles

Discussion in 'Shaders' started by nsmith1024, Oct 10, 2016.

  1. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    291
    Hello,

    I build my scene into an asset bundle, when the scene is loaded dynamically during the game from the server, everything is pink, including the trees, water4Advanced etc (Im running it in the editor).

    When I look at the inspector, I see everything looks normal in that the shaders and materials are listed (does not say missing or none), but they are not drawn on the screen.

    I notice that if while the game is running in the editor, I click on the " water4Advanced Tile" object in the scene, the inspector shows shader as "FX/Water4". If i simply select that same shader again then suddenly the water appears, where before it was pink (the other objects are still pink like trees etc by the way)

    Anybody knows why?

    im using Unity 5.4.0b24

    Thanks
     
  2. matthieups

    matthieups

    Joined:
    Sep 14, 2016
    Posts:
    9
    Hi,

    got exactly the same issue here (data downloaded from an assetbundle). Everything is fine in the inspector: materials and shaders are correctly listed but everything renders pink (please note that all the shaders and materials are located in my Resources folder and that the Always Included Shaders list in the Graphics settings is up-to-date).

    Help needed!!

    Thanks
     
  3. matthieups

    matthieups

    Joined:
    Sep 14, 2016
    Posts:
    9
    Fixed! This was because my assetbundle was generated for Android or IOS using the OpenGL ES API whereas the editor/player, by default, runs the DirectX driver.
    I just had to change the PC, Mac, Unix player settings by unchecking the Auto Graphics check boxes and putting OpenGL ES as the main default Graphics API on each platform.
     
  4. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    291
    The solution is this. If you build asset bundle for lets say WebGL variant, when you run it in the editor and it loads that asset, it will have the pink (because you are not really running WebGL, since you are running in the editor)... But when you run it for real in the browser (the real WebGL) it works, no more pink.