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

Sprite diffuse shader which works as the default one only for specific colors

Discussion in 'Shaders' started by Redden44, Mar 7, 2017.

  1. Redden44

    Redden44

    Joined:
    Nov 15, 2014
    Posts:
    159
    Hi, I'm using lights in my 2D game and I need to have some parts of the sprites affected by lights, while others not; for example if a mage casts a fireball, I need the fire in its hands to be bright, uneffected by the lights, while the rest of the body should bedark, affected by the lights.

    I know pretty much nothing about shaders, so I'm wondering if I can use them to achieve that..use the diffuse shader but specify a set of colors to be uneffected by lights. Is it possibile?

    The alternative is to add another sprite renderer with the default shader and use it only for these effects. If is possibile to make the shader, which solution would be better / lighter?

    Thanks.