New Node Reference Samples

The Shader Graph team is excited to announce the release of the new Node Reference Samples, available now for 2021 LTS, 2022 LTS as well as 2023.

Node Reference Samples is a collection of over 140 Shader Graph assets. Instead of using these graphs for materials in your project, use them as a reference to learn what each node does and how it works. Each graph represents a node that’s available in the node library, contains a description of the node, and shows how the node is used. Also included are breakdowns of how the math works under the hood and examples of what the node can do. If you want to know how to use a specific node, you can open up its reference file in these samples and see descriptions, examples, and breakdowns of that node.

Read all about the new samples in our blog post and take a look at the video we created that shows how to install and use the samples.

We would love to get your feedback! Take a look at the new samples and let us know what you think in this thread.

13 Likes

Wow, this is great! I’ve been watching quite a few of your Youtube tutorials, Ben, and it’s helped me a lot in my first steps understanding shaders! This is a resource I’ve been looking for for a long time! Hope Unity chooses to do something similar for the VFX Graph too :slight_smile:

1 Like

This is an absolute win, I’ve been lazy to read shader graph’s documentation mainly because it’s a little “boring”, having the explanation of each node visualized with examples makes memorizing shader graph so much more easier, the moment I saw the blog I knew Ben is probably the one behind it, thank you for your work at Unity and at your personal channel, it’s incredibly helpful!

Small request, a tutorial about Surface Gradient Bump Mapping would be huge.

Glad this is going to be useful for you - and thanks for the suggestion about surface gradients. I’ll see if we can add that to our list for the next sample release/

2 Likes

This is amazing. I already learned a lot from just few sample images from blog post.
I didn’t know dot can be used to desaturate color!?
Can’t wait to dive into it on the weekend. Especially because this stuff is good foundation knowledge that apply to other engine as well.
Credit where it due. Good job team. Really appreciate these ‘tech from trench’ blog posts.

1 Like

How do we add the new “node reference samples” to 2021.3 LTS with ShaderGraph version12.1.12.

Same question for 2023.1.20; I only can see the “Procedural Patterns”.

I have Unity 2022.3.3f1 and Shader Graph 14.0.8 and I can’t see the samples.

EDIT:
OK, Unity 2022.3.13 is needed.

@BenCloward I appreciate the quality of these examples; they are indeed excellent.

I’d like to propose an idea for streamlining the workflow. Rather than packaging these as a separate sample set, could you consider a functionality where a double-click on the primary base node opens a read-only version containing these examples. This approach would ensure that these resources are readily available to all users, irrespective of their sample import status, enhancing accessibility and user experience.

1 Like

For those that can’t find the samples, please ensure that you’re on the newest version of 2021 LTS, 2022 LTS, or 2023.3. This is a few feature, and we were able to back-port it to 2021 and 2022, but you’ll need to make sure you’re on the latest version to see it.

@Kane_321 This is a really good idea and it has been brought up several times internally. It would be much more effective if the samples were available via the individual nodes themselves. The tech hurdle for us is that, in the way it’s currently organized, users would need to have the sample installed for it to work - and it’s likely that most users will not have it installed. Either that or we would need to include the sample content with Shader Graph itself - which would make the package more than double the size it currently is. All this to say - this is something that we want to do for sure, but there are some issues we need to get worked out in order to make it work, and I thought it would be better to make the content available now while we figure those things out rather than hold on to it until then.

2 Likes

how about 2023.1 or 2023.2 ? Will it be available there, too? 2023.3 is still alpha.

We hadn’t planned on adding it to 23.1 or 23.2, but if enough people ask, we may consider it. For now, you’re welcome to create an empty project in 22 LTS just for browsing the samples and then copy/paste parts of graphs, or export custom packages from there into your current project. I know it’s a hassle, but it’s doable now rather than needing to wait for us to do something.

1 Like

This sounds great, however the total lack of a starting point for a lit shader was the previous main problem for Shader Graph. Can you start from a complete lit graph layout (URP or HDRP lit shader equivalent with exact same inputs) yet?!
Question - URP Lit Shader in Shader Graph - Unity Forum

1 Like

Hi andyz. Thank you for the reminder!

2 Likes

Hi @andyz ,

Thanks for the heads up indeed :slight_smile:
We do have Templates on the back of our heads for some time.

I’m curious to know how much abstraction you’d like to see in these. Like would you like them to be one big flat graph, broken down in Sub Graphs, one big Sub Graph?

Thanks for your input.

1 Like

Thanks for the pickup! Templates look like thing missing.
Been away from shader graph for a while but,
in my case I might want a material much the same as a standard lit one but with some minor difference - tri-planar etc. texturing, some additional effect on top… So in this instance I want to create a shader 90% like a Lit (or unlit) shader but add or change a part of the graph.

Currently I have to (afaik):

  1. re-create the nodes in the Blackboard for common inputs (not every one, but I want same names so I can use standard code to apply properties in script on all materials). You can edit the shader of a standard material to get the reference names! Not sure Shader graph helps you there
  2. Put them in the graph and connect it up - bit of a guess
  3. Add/change portions of graph

I don’t know how complex a complete recreation of the Lit shader as a graph is (perhaps at least limit to 1 template per Material type!) - but any starting point with the most common nodes setup, something between inputs and fragment shader would be a good start thanks!

1 Like

Hi.

Node reference samples are great resources for learning Shader Graph and shading self.
But I’ve found some issues of them.
For example, there are some misspellings on their description note…

White Balance Node:
Tempurature adjusts the data on a gradient between cool (cyan)”

Temperature

Not Node:
“The Node Node inverts the boolean input value”

Not Node

UV Node:
“The UV node bring’s the mesh’s …”

brings
( Normal Vector Node has same issue)

Sample Texture 2D Node:
Contect a Sampler State node to the Sampler input port …”
maybe “Connect” ?

Degree to Radians Node:
“This node is useful because rotation values in degrees are often more intutive to understand as inputs for artists”

intuitive
“but the trig math functions generally expect inputs in radians”
what means “trig”?

Length Node : (in Length and Distance Group)
Mesauring the length of the View Vector or finding the distance”

Measuring

Posterize Node:
“The Posterize Node converts a continuos gradient into a set of uniform steps”

continuous

Power Node (Adjusting Image Contrast)
“Sine Time provides us with a continuos wave between -1 and 1.”

continuous

Is Front Face Node:
“The Is Front Face Node returns true if the current rederring face is pointing toward the camera”

rendering


Because I am not native in English, I’m not confident about these issues.
So please check them.

And there are some confusing descriptions.

And Node:
This description maybe wrong.
Even though AND only returns True when A and B are both true,
this description suggests AND node returns True when both value are same.

Nand Node:
This node has also wrong description.
Nand only returns false when both is true.

Cross Product Node:
sticky note is just slightly small height. This is very slightly, not problem.

These are issues what I noticed.
So I don’t know where I should report, I list up them here.

It’s very kind of you to compile such a thorough list, @miur-us ! Thank you very much for your help. I will fix these.

1 Like

@miur-us I’m in the middle of fixing these now and I noticed your question about the meaning of “trig.” That’s short for trigonometry. It’s referring to functions such as sine, cosine, tangent, arcsine, arccosine, etc. These usually expect input values in radians, but degrees are easier for artists to understand, so the Degrees To Radians node can be used to convert artist-friendly values in degrees to radians before passing the values into trigonometry functions. I hope that helps make it more clear.

2 Likes

Thank you very much for your help.
You’re welcome!

That’s short for trigonometry…
Thank you for explanations of details.

Shader Graph is really authentic tool.
I hope it will be more convenient!