Search Unity

Question Sprite does not appear when using Color property in Shader graph (Sprite Lit Master Graph)

Discussion in 'Shader Graph' started by blackroomboy, Jul 12, 2020.

  1. blackroomboy

    blackroomboy

    Joined:
    Apr 5, 2018
    Posts:
    10
    Hi, I have a very simple Shader Graph which uses a Sprite Lit Master node. The graph smooths the edge of a circle sprite and adds a Simple Noise effect to it.

    Issue: When multiplying the Color property, it appears alright in the Main Preview window. But in the Scene, the color does not change to the color set in the Shader graph. I also cannot change the color of the sprite through the Color picker in the editor (sprite color remains grey).

    Note: Alpha in color property is set to 1.

    Shader Graph:
    Sprite Lit Master.png

    Sprite (in scene):
    Screenshot (10).png

    Inspector (settings):
    Screenshot (9).png

    Am I missing something in the inspector settings or in the shader graph?

    Thanks in advance.
     
    ferverence likes this.
  2. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,514
    I'm finding that "_Color" is not behaving expectedly. For me, what happens is that the SpriteRenderer's color always takes effect, whether or not I want to use it. This is the case whether there's a property with reference "_Color" or not. I haven't found a way to get the material to ignore the SpriteRenderer.color. I'd like to do that in some circumstances. In some cases I want to apply the SpriteRenderer's color before what's driven by the shader, but that's also a mystery to me because if I try to do so in the shader it's like the color is multiplication afterward always.
     
  3. blackroomboy

    blackroomboy

    Joined:
    Apr 5, 2018
    Posts:
    10
    Once I apply a material to the Sprite Renderer, the Color property does not work. And I can't even change the color of the sprite from the color property in the Shader Material component. I don't really know what's the issue here.
     
  4. blackroomboy

    blackroomboy

    Joined:
    Apr 5, 2018
    Posts:
    10
    Hi @bgolus, do you know why I might be getting this issue? Even setting a different sprite in the Shader graph under the _MainTex doesn't change the sprite in the Scene/Game.