Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Big collection of free Shader Graph nodes

Discussion in 'Graphics Experimental Previews' started by Giles-Coope, Jul 5, 2018.

  1. Giles-Coope

    Giles-Coope

    Joined:
    Jan 5, 2015
    Posts:
    47
    Hey Unity people.

    I've been working on some shader graph node libraries in the past week or so. I'd be very happy to get some feedback on these and would love to hear if you've used any of them for any of your projects.

    https://github.com/gilescoope/shader-graph-nodes

    Complex



    Do complex arithmetic in shader graph.

    Composite



    Complete set of Porter Duff transparency operations.

    Halftone



    Halftone rendering, monochrome or color.

    Lab Color



    Manipulate colors in the perception-based color spaces.

    Pattern



    Procedural geometric patterns.

    Pixel Perfect



    Pixel-wide primitives, no matter what the surface.

    Quaternion



    Quaternion algebra for rotation calculations in the graph.

    SDF



    Signed distance functions for amazing procedural effects.

    Truchet



    Truchet tiling nodes to make beautiful irregular patterns.
     
  2. Slaktus

    Slaktus

    Joined:
    Dec 5, 2012
    Posts:
    6
    Thanks so much for these! Been playing around with them for a couple of days now, and particularly the SDF and truchet nodes offer a ton of possibilities.

    So far this pretty garden-variety alpha-blended SDF-based cartoon water is the best example I've got, but will post more graphs when I come up with something more exciting

    Edit: Wow, embedding images by link or upload is tremendously broken
     
    Last edited: Jul 26, 2018
    Shorely and Giles-Coope like this.
  3. Giles-Coope

    Giles-Coope

    Joined:
    Jan 5, 2015
    Posts:
    47
    That looks great, looking forward to seeing more stuff, let me know if there was something that wasn't clear or any functionality you felt should have been there but wasn't.
     
  4. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    466
    Any chance for a Blur or Distort node?
     
    Franckitou likes this.
  5. Giles-Coope

    Giles-Coope

    Joined:
    Jan 5, 2015
    Posts:
    47
    Shader calculations are done per pixel without accessing other pixel information (aside from DDX, DDY, fwidth) so a blur node doesn't make too much sense.

    Distortions are possible, what distortions would be interesting?
     
  6. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    466
    The best example I can give is the noise texture node from Blender but for Unity I'm not sure how the distortion would work for different types of input as a separate node. Here it's embedded in the Noise node

    No distortion
    upload_2018-8-30_16-25-52.png

    With Distortion
    upload_2018-8-30_16-26-17.png
     
  7. miniduck

    miniduck

    Joined:
    Sep 27, 2012
    Posts:
    117
    Thanks for this!
     
    Giles-Coope likes this.
  8. PeterLDavis

    PeterLDavis

    Joined:
    Feb 26, 2018
    Posts:
    3
    How would I go about installing these?
     
  9. Giles-Coope

    Giles-Coope

    Joined:
    Jan 5, 2015
    Posts:
    47
    Hey there, from the GitHub page here

    https://github.com/gilescoope/shader-graph-nodes

    you can just click "Clone or Download" then "Download .zip"
    If you extract your zip somewhere into your Project > Assets folder you should be able to use all the nodes from Shader Graph as you would use any other nodes.
     
  10. PeterLDavis

    PeterLDavis

    Joined:
    Feb 26, 2018
    Posts:
    3
    Thanks for getting back to me! That doesn't work, however (it was the first thing I did). Nodes simply don't appear in the graph editor.
    Could this be a version thing? I'm running 2018.2.14f1
     
  11. Giles-Coope

    Giles-Coope

    Joined:
    Jan 5, 2015
    Posts:
    47
    I'm not sure, do you get compilation errors? Do you have the correct packages installed?

    I just tried with 2018.3.0f2.
    - start a new project with the Lightweight RP (Preview) template
    - copy the "Nodes" folder from the repository into the project assets folder
    - create a shader graph

    Now when I right click and select "Create Node" I can see all the nodes.
     

    Attached Files:

  12. PeterLDavis

    PeterLDavis

    Joined:
    Feb 26, 2018
    Posts:
    3
    I think there was something vestigal in my current project that was stopping the nodes from compiling properly or just working at all. All newly created projects (LWRP and HDRP) seem to pick them up just fine. Thanks for your help, I really appreciate it :)
     
    Giles-Coope likes this.
  13. Giles-Coope

    Giles-Coope

    Joined:
    Jan 5, 2015
    Posts:
    47
    That's good to hear. I hope you can get the nodes in your project. If you get to the bottom of why it wasn't working I'd be interested to hear.
     
  14. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    508
    Unity broke nodes by making function node class internal, my project depends on those, what should i do?
     
  15. Giles-Coope

    Giles-Coope

    Joined:
    Jan 5, 2015
    Posts:
    47
    Ouch, thanks for letting me know about this. I'll take a look as soon as I have some time. Which version of Unity is this?
     
  16. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    508
    19a14
    sg 5.2.3
     
  17. Giles-Coope

    Giles-Coope

    Joined:
    Jan 5, 2015
    Posts:
    47
    Thanks, I managed to reproduce this. I guess it's someone in the Unity team setting the class to internal without thinking. It wouldn't be the first time I've seen this.

    I saw that you posted this already in the megathread so will wait to see what the response is there. I believe there's very little I can do. In the meantime I'd suggest working in the last version of shadergraph that doesn't have this restriction.
     
    pointcache likes this.
  18. Jick87

    Jick87

    Joined:
    Oct 21, 2015
    Posts:
    123
    From what I've heard, they did this intentionally. It is because they are working on redoing the API, so any custom nodes will need to be updated to work with the new API. I guess they made it private so less people will try to use it in the interim, and thus less people will need to redo their custom nodes..? My understanding is the new API is supposed to be available by the time 2019.1 is released.
     
    Giles-Coope likes this.
  19. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    1,207
    If you want custom nodes basically need to stick sg 4.6 (and therefore unity 18.3) until they release their new api.
     
  20. reto5messerli

    reto5messerli

    Joined:
    Oct 14, 2018
    Posts:
    6
    there is now a new way to make custom nodes in unity 2019. there is a "custom node" node in which you can copy paste the hlsl code. its pretty easy to use. you will also have to update the lwrp or hdrp to a newer version when creating a new project.