First shader issues. [Fixed]

The preview shows my Shader Graph working perfectly yet doesn’t when I use it on a Material. (Sometimes, models would turn fully transparent with other graphs.) Any idea how to fix? This is my first shader and I admit my knowledge is limited.

Built-in 2022.3.22f1 - Yes, it does support Shader Graph, has for years.

Here’s the shader for anyone who’d be willing to help and fix.

100000001316397--1404579--Untitled-1.png

Hey @MaxwellFury ,

I took a look at your Shader Graph.
It seems that the Tiling and Scale properties were to Global (not exposed).
So, unless you set them from code with Shader.SetGlobalVector() and Shader.SetGlobalFloat(), they will default to zero.
Setting those two as exposed (Local / Per Material) fixed what I believe your issue was.

You can read more about Property Scope in this thread .

Hope this helps.

Thank you so much!

Everything seemed fine until I noticed the textures for metallic and mask don’t apply when using the shader. The material’s appearance should change when I add one.
@FredMoreau [Shader link.]

Hi, I had a quick look.

I’m not sure what you expect the Clamp node to do, but as you set the min and max to the same value, it’ll just output that value. Bypassing the clamp makes the texture reveal in material.
I believe you want to use a Step, or InverseLerp node instead.

I’ve managed to have occlusion and metallic apply, however metal values 0 and 1 are inverted for unknown reasons and don’t seem to be fully working like the Standard shader. I’m still unable to have the mask map apply, choose the alpha threshold,or add a secondary albedo. New link. @FredMoreau

Could someone make the fixes? I’m willing to pay. I’m very new to shader making. X3

There’s nothing wrong in your Graph, except it doesn’t do what you expect. So it’s kind of difficult to fix anything.

The key is to properly visualize the output of a Node given varying outputs. I acknowledge that it can be tricky sometimes.

@BenCloward has a great Youtube channel with everything you need to learn about Shader authoring.
He’s also made the Node Reference and Feature Examples Samples, which can greatly help.

I’ve managed to get the shader working. :slight_smile:

1 Like