1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. We’re giving 2017.1 beta testers a chance to win t-shirts and a Nintendo Switch. Read more on the blog.
    Dismiss Notice
  4. We want to know how you learned Unity! Help us by taking this quick survey and have a chance at a $25 gift card
    Dismiss Notice
  5. Are you an artist or level designer going to Unite Europe? Join our roundtables there to discuss artist features.
    Dismiss Notice
  6. Unity 5.6 is now released.
    Dismiss Notice
  7. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice

Shaders and asset bundles

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

  1. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    289
    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:
    289
    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.