Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Assetbundle models shader (unlit/texture) not applied to model

Discussion in 'Shaders' started by relsirc, Sep 11, 2014.

  1. relsirc

    relsirc

    Joined:
    Jul 3, 2013
    Posts:
    20
    I'm using assetbundle to load some 3d models. These 3d models uses the default unity shader (unlit/texture).

    When I downloaded/used the bundle, I only see pink in my models texture.

    Can anyone help me with this? or any idea how to apply the default shader to the model in the assetbundle?
     
  2. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    1,520
    If I'm not mistaken, shaders are not included in an Assetbundle. So you have to make sure the shader is already included in the project. You could place a dummy script that references the shader to make sure it's included.
     
  3. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    The planed way is that you go under Edit -> Project Settings -> Graphics an put / select you shader that you will use in the assetbundles in there.
    All other unused shader will get stripped out of the game build to reduce size.
     
  4. relsirc

    relsirc

    Joined:
    Jul 3, 2013
    Posts:
    20
    thanks for replies. Greatly appreciated

    I tried putting the shaders in the Edit -> Project Settings ->Graphics settings, but whenever I reopen Untiy, it doesn't seem to be saved even though I saved the whole project. It seems like it's a Unity bug.