Search Unity

Question How can I "combine" these two materials/shaders in Shader Graph?

Discussion in 'General Graphics' started by ZeHgS, May 23, 2022.

  1. ZeHgS

    ZeHgS

    Joined:
    Jun 20, 2015
    Posts:
    117
    Hi everyone!

    I am using HDRP and Shader Graph. From what I researched, it seems that shaders can't be combined but that I can apply two materials. However, when I do, they aren't really combining as I was hoping they would.

    I have a character:
    upload_2022-5-23_1-17-9.png

    And I want to apply a shader to create a teleportation effect:
    upload_2022-5-23_1-18-5.png

    It slowly disappears with glowing edges. I learned this effect from this Brackeys video and I simply replaced the time node that connected to the Alpha Threshold and made everything disappear with a float that I intend to animate from script.

    When I add both materials to my skinned mesh renderer, two problems happen, independently of the order of the materials in the materials list.

    1) Instead of fully disappearing when the alpha threshold is set to 1, it just becomes a being of light:
    upload_2022-5-23_1-20-57.png
    2) I can't see the other material at all. I simply see the base color of the teleportation shader when the threshold is set to 0.

    I tried a few things but can't seem to disable the "base color" for my shader. I tried making the teleportation shader's material transparent, which reveals the other material underneath but two other problems occur.

    1) I can still see the base color of the teleportation shader (a grey) when the alpha threshold is set to 0.
    upload_2022-5-23_1-24-44.png
    2) When the alpha threshold reaches 1, the other material doesn't disappear at all as I was hoping it would and the character's normal material shows fully through.

    My teleportation shader:

    upload_2022-5-23_1-30-43.png

    What am I doing wrong? How can I combine both?

    Thanks a lot!