Search Unity

Shader Graph and unnecessary Vertex Colors (LWRP 2D)

Discussion in 'Shaders' started by GamerXP, Aug 2, 2019.

  1. GamerXP

    GamerXP

    Joined:
    Mar 22, 2014
    Posts:
    78
    Hello. I'm trying to redo one of my shaders with Shader Graph's new Sprite Lit master node.
    Problem is that I use sprite's color to store some internal data (so I don't have to create separate materials for every sprite), but shader keep multiplying final color by sprite's color, and I can't find how to disable this behavior.

    Code (csharp):
    1. surf.Color *= IN.VertexColor;
    2. return surf.Color;
    Is there a way?
     
  2. Tom-Atom

    Tom-Atom

    Joined:
    Jun 29, 2014
    Posts:
    153
    GamerXP likes this.
  3. GamerXP

    GamerXP

    Joined:
    Mar 22, 2014
    Posts:
    78
    Thanks. That should do for now. I posted same things in 2D Dev branch a long time ago, hope they will do something about it