Search Unity

Multiple shaders for a 2D sprite?

Discussion in 'Shaders' started by viveleroi, Jun 29, 2017.

  1. viveleroi

    viveleroi

    Joined:
    Jan 2, 2017
    Posts:
    91
    I was using the default Sprite/Diffuse shader for a 2D sprite but have added a new shader from an asset I bought. As expected the new shader gets applied but there's no way to apply the old Sprite/Diffuse.

    I've considered manually merging the shader source code, which I've done before, but I want to make sure there's no secret method of having two shaders applied to a 2D sprite before I do.
     
  2. neitron

    neitron

    Joined:
    Sep 14, 2014
    Posts:
    14
    Hi, at first - shader just a part of a material. Sprite in unity can have only one material, so only one sprite. Anyways it is better to merge features that you need in one shader. But there is one stuff could be useful for you - Replacement Shader. You can have a shader with the second one as a replacement. Replacement Shader can replace passes with own passes via tag matching (a pass from your shader has to have the same tag as a pass from replacement one).

    Hope it will help you ) (sorry for my English, I hope you get me)
     
  3. vetasoft

    vetasoft

    Joined:
    Nov 15, 2013
    Posts:
    432