Search Unity

Replacing internal billboarding shader - works, but only until next restart. What am I doing wrong?

Discussion in 'Shaders' started by kmoosmann, Jun 24, 2015.

  1. kmoosmann

    kmoosmann

    Joined:
    Mar 1, 2014
    Posts:
    22
    Hey there guys,

    Working on Unity 4.6

    I need to replace the standard tree billboarding shader of Unity's terrain system. I still have the shader source for that specific shader that we were able to download not too long ago (it's apparently gone now).

    I modified that shader to get rid of an alpha testing issue we were experiencing in our project. But after the import, it only works as long as Unity is running. As soon as the project is loaded again, Unity reverts back to it's own internal shader instead of using the modified one (Shader name, path name within the shader are definitely correct). The modified one also doesn't transfer into a build.

    I tried the tricks some people suggested, like attaching the shader to a game object within the scene, putting it into the Resources folder (Resources/TerrainShaders/Trees) and also putting it into a standard resources folder - to no avail. The issue persists, when I reimport the shader it works - after a Unity restart it defaults to the internal one again.

    Is there any way around this? Really desperate here... :/
     
  2. spraycanmansam

    spraycanmansam

    Joined:
    Nov 22, 2012
    Posts:
    254
    Not sure about the in-editor side, but for the standalone I've had to add my replacement shaders to the "Always Included Shaders" under Edit -> Project Settings -> Graphics. Worth a try.