José Guedes
José Guedes

Reputation: 400

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

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 https://www.youtube.com/watch?v=taMp1g1pBeE 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 character's normal material simply shows fully through instead of the character disappearing as I want it to.

My teleportation shader:

enter image description here

My renderer settings:

enter image description here

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

Upvotes: 2

Views: 5829

Answers (1)

obieFM
obieFM

Reputation: 73

What you will want to do is use just one shader, your teleport shader, and add nodes to it for the base texture. Then, using the Add node, you can combine with the current input of the Base Color fragment slot.

Upvotes: 1

Related Questions