Search Unity

Official New Node Reference Samples

Discussion in 'Shader Graph' started by BenCloward, Nov 14, 2023.

  1. BenCloward

    BenCloward

    Unity Technologies

    Joined:
    Jul 15, 2021
    Posts:
    143
    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.
     
    Last edited: Nov 15, 2023
    olavrv, impheris, Smith_076 and 8 others like this.
  2. Semiterrestrial

    Semiterrestrial

    Joined:
    May 20, 2020
    Posts:
    1
    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 :)
     
    BenCloward likes this.
  3. JiRo_Dev

    JiRo_Dev

    Joined:
    Jun 8, 2018
    Posts:
    48
    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.
     
  4. BenCloward

    BenCloward

    Unity Technologies

    Joined:
    Jul 15, 2021
    Posts:
    143
    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/
     
    JiRo_Dev likes this.
  5. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    300
    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.
     
    BenCloward likes this.
  6. keattikorn

    keattikorn

    Joined:
    Feb 19, 2014
    Posts:
    3
    How do we add the new "node reference samples" to 2021.3 LTS with ShaderGraph version12.1.12.
     
  7. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    871
    Same question for 2023.1.20; I only can see the "Procedural Patterns".

     
  8. Micz84

    Micz84

    Joined:
    Jul 21, 2012
    Posts:
    451
    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.
     
    Last edited: Nov 16, 2023
  9. Kane_321

    Kane_321

    Joined:
    Aug 6, 2017
    Posts:
    7
    @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.
     
  10. BenCloward

    BenCloward

    Unity Technologies

    Joined:
    Jul 15, 2021
    Posts:
    143
    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.
     
    almarian98 likes this.
  11. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    871
    how about 2023.1 or 2023.2 ? Will it be available there, too? 2023.3 is still alpha.
     
  12. BenCloward

    BenCloward

    Unity Technologies

    Joined:
    Jul 15, 2021
    Posts:
    143
    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.
     
    Qleenie likes this.
  13. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,281
    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
     
  14. BenCloward

    BenCloward

    Unity Technologies

    Joined:
    Jul 15, 2021
    Posts:
    143
    Hi andyz. Thank you for the reminder!
     
    andyz likes this.
  15. FredMoreau

    FredMoreau

    Unity Technologies

    Joined:
    May 27, 2019
    Posts:
    168
    Hi @andyz,

    Thanks for the heads up indeed :)
    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.
     
  16. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,281
    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!
     
    Last edited: Nov 22, 2023
    FredMoreau likes this.
  17. miur-us

    miur-us

    Joined:
    May 3, 2019
    Posts:
    2
    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.
     
  18. BenCloward

    BenCloward

    Unity Technologies

    Joined:
    Jul 15, 2021
    Posts:
    143
    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.
     
    miur-us likes this.
  19. BenCloward

    BenCloward

    Unity Technologies

    Joined:
    Jul 15, 2021
    Posts:
    143
    @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.
     
    miur-us likes this.
  20. miur-us

    miur-us

    Joined:
    May 3, 2019
    Posts:
    2
    >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!
     
  21. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,281
    Degrees are easier to understand for many programmers too! :D
     
  22. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,670
    Unity needed this many years ago... anyways, this can be useful... i like it...

    You are that guy from YouTube @BenCloward! your youtube channel is pretty useful and great, i have many tutorials on my bookmarks.
     
    Last edited: Mar 16, 2024
    bb8_1 likes this.
  23. simonrcodrington

    simonrcodrington

    Joined:
    Aug 25, 2018
    Posts:
    8
    I just wanted to quickly come here and thank you guys for the quality resources and examples.

    Historically I've noticed that it's been very hard to get great hands on examples of shadergraph. However it seems you guys are really starting to put out more interactive and useful examples / demos of unity features and I'm really keen on it.

    Having these interactive things, especially with all the notes, links and features will help people better understand the core concepts (and in turn we'll get better games out of it)

    Really interested to see what more examples, tutorials and breakdowns you guys will be releasing in the coming months.

    Keep up the good work
     
    impheris, BenCloward and FredMoreau like this.
  24. CodeMonkeyYT

    CodeMonkeyYT

    Joined:
    Dec 22, 2014
    Posts:
    125
    I just want to share my appreciation for this really awesome sample!
    I love how the scene is set up with all the clear examples and excellent documentation, thanks for making it!
     
    FredMoreau, WingedViking and NathanG like this.
  25. BenCloward

    BenCloward

    Unity Technologies

    Joined:
    Jul 15, 2021
    Posts:
    143
    You're welcome! I'm really glad to hear that it was useful for you!