Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved Shader Graph Layered Textures - Blend Overlay Not Working

Discussion in 'Shader Graph' started by Gmanicus, Dec 15, 2020.

  1. Gmanicus

    Gmanicus

    Joined:
    Dec 14, 2020
    Posts:
    6
    Hello there,

    I am attempting to basically layer textures in shader graph. I would like to essentially have a noise cutout of my sprite, and then paste that over the original sprite that has been altered in some way. Currently, I'm just testing with a hue shift to purple as the base texture, and then I'm attempting to overlay the cutout onto it. Weirdly, I'm not even close to that behavior. You can see the result I'm getting in the preview. I've been messing with this for over an hour at this point, and I haven't been able to find any answers online.

    Would anyone mind pointing me in the right direction to achieve the above behavior? Double points if you can explain why the frick this isn't working.

    Also, don't ask me why the texture frays in the texture preview. It works, but I have no idea why it looks that way.




    Intended result (yes, it's eye-cancer. This is just for testing):
     
    Last edited: Dec 15, 2020
  2. Gmanicus

    Gmanicus

    Joined:
    Dec 14, 2020
    Posts:
    6
    A friend from a game dev server helped me out with this one.

    Blend doesn't work because... actually, I still don't quite know why it doesn't work. I know part of it, which is that it will actually blend the colors together. It overlay's the texture and then attempts to mix the colors, I guess? Here's what my friend shared with me: A chart of blend modes and what they do.

    Anyway, the solution was to use the lerp module to lerp the alphas of the two textures so that they appear as being placed in layers. The texture I want on the bottom goes into A, and the texture I want on top goes into B. You then take the alpha layer of the texture you want on top and plug it into T.

    Viola:
     
  3. ClearRoseOfWar

    ClearRoseOfWar

    Joined:
    Sep 6, 2015
    Posts:
    87
    Thank you.
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,533
    Rather than necroing a thread, please use the like button instead.

    I'll also move this thread which isn't related to 2D to the Shader Graph forum.

    Thanks.