Search Unity

Feedback Wanted: Shader Graph

Discussion in 'Graphics Experimental Previews' started by Kink3d, Jan 10, 2018.

Thread Status:
Not open for further replies.
  1. Demkeys

    Demkeys

    Joined:
    Nov 14, 2014
    Posts:
    30
    I made a post with 2 questions a day or two back. It's post #186. Anyone got any suggestions?
    The second question is really more of a feature request.
    I would post the questions again but I'm not sure if that would be considered spamming.
     
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    Shader graph ties in pretty tightly with the rendering pipeline that you have. We don't expose concepts like 'multi-pass' to the graph. You will be able to modify offset positions though when we add vertex shader support.

    When talking about shaders in a graph like this you are not looking at one float value, you are looking at the value across a surface. We can't easily display this as a text value so we show it as a color so you can see the value as it changes across a surface.

    As for colors getting cut off... that's a good point, maybe we should add some range controls to the preview node.
     
    Demkeys likes this.
  3. Demkeys

    Demkeys

    Joined:
    Nov 14, 2014
    Posts:
    30
    Good to know that's coming in the future.
    Oh wow. The 'across the surface' thing never occurred to me. I was looking at it the wrong way. Appreciate the info man.

    Also, I got an error with this node setup. Figured I'd report it. Here's a screenshot of the shader graph:
    screencap.png

    The error message is: Shader error in 'graphs/MyShaderGraph03': unrecognized identifier 'Matrix4x4' at line 36 (on d3d11)
    I should mention I'm still using Unity 2018.1 Beta 2.
     
  4. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    We have a number of bugs in matrix nodes that @Kink3d is fixing.
     
    Demkeys likes this.
  5. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    804
    It is not possible to do hd shaders at the moment, right? Is there a place where to look for the info if it became available other than being annoying and asking somebody?
     
  6. izym

    izym

    Unity Technologies

    Joined:
    Jul 27, 2013
    Posts:
    24
    The HD Master Node is currently in development. We'll definitely announce it in this thread and the SRP thread when it's ready :)
     
  7. izym

    izym

    Unity Technologies

    Joined:
    Jul 27, 2013
    Posts:
    24
    Here's a small preview of the upcoming release of Shader Graph, including (but not limited to) a fresh new look for the blackboard (the window that holds your properties) and some productivity improvements to node search, allowing you to directly add properties as well as select slots other than the first compatible one:
     
    Alverik, Demkeys, supron and 2 others like this.
  8. Psiber

    Psiber

    Joined:
    May 23, 2017
    Posts:
    1
    Hi guys,

    loving the work so far on this. A brilliant addition to the base engine and everything I have tested so far works beautifully.

    One question I do have though is can we get additional procedural noise variants? Perlin, Simplex, Ridged Multifractal for example?

    I do a lot of procedural work and use these often so was surprised to see voronoi and white noise and not much else.
     
  9. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,284
    Looks cool. I have an idea to suggest.

    I think the shader editor would be useful in GPGPU programming for things like image recognition.

    For example if you look at the tensorflow library used for neural networks, it does operations on tensors which are basically NxMxOxP... tensors. The shader graph does operations mainly on NxMx4 tensors. (RGBA).

    In particular if you consider convolutional neural networks, useful commands to include would be:
    • convolutions
    • max pooling
    • reshaping tensors
    Well anyway, just an idea that it would be cool if the shader graph could be adapted to be extended to use on various machine learning situations.

    I was building such a system using tensorflow and python. But I'm wondering whether it might be possible to adapt the shader graph system in the upcoming unity to do something similar.

    Secondly I'm wondering if you could add the node system to your actual game as an addition to the GUI (not just use it in the editor) that would also be pretty cool.

    • Another feature that I would like in shaders is to be able to have a set of vertex shaders and a set of pixel shaders and combine them in any pair combinations i like.

    • A third thing, is can you make it so it is completely keyboard accessible so you don't have to keep switching to a mouse?
     
    Last edited: Jan 27, 2018
  10. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,348
    I don't think there's crossover here, it's not meant for GPGPU programming... (also clicked merge on your posts)
     
  11. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,284
    Is this nested prefabs? Sounds like shaders with sub-shaders and so on needs Unity to finally implement a nested prefab system to make it work!

    So it won't work with ComputeShaders? That would be a shame. It would probably be a costly missed opportunity IMO. Simply because in the future it might be harder to retrofit this with GPGPU if it's not thought about from the start. (Basically what's needed is to feed the result of the shader back into the input texture. Then you can make cool things like fractals and the classic conway's game of life and fluid dynamics simulations.)

    I'm just trying it out. Here are my notes:
    • Text is a bit blurred when zooming out. Perhaps make the text bigger? Or just make everything more condensed? Too much wasted space between lines of text. How do I know when zooming is 100%?
    • Could nodes snap to a grid?
    • Would be nice if the title bars of the nodes had some colour and bold text
    • Previews could be 25-50% smaller.
    • Could have drag to expand nodes for bigger preview
    • Are the numbers in brackets really necessary? Perhaps could just show if you hover over it.
    • Might there be an option to view the graph mirror imaged, right to left? Might make sense to some people.
    • Are the X,Y,Z labels really necessary for inputs?
    • Some nodes are collapsible but not others?
     
    Last edited: Jan 27, 2018
  12. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    509
    Any chance in the future ShaderGraph produces readable HLSL shader code that we can manually edit?
     
  13. Kustuk

    Kustuk

    Joined:
    May 29, 2016
    Posts:
    8
    Please, make "create" menu appear by the "Tab" shortcut - it is kinda industry standard these days
    And also qiuck search text input in this menu - that's how it works everywhere: Houdini, maya, nuke, blender (blender uses Space key for that but everythigh other than that is the same as others).
    But there's two way to do quick search - good and bad:
    Bad way - used in Nuke - user always has to type letters in correct order. For example: I want to create "ViewMetaData" node. I need to hit Tab and type exactly "v i e w m e t a ... " and so on. That's very inconvinient because user has to remember exact node names. In this example I could forget exact node name. I could remember that it was something about metadata in name and if I type metadata Nuke won't find anything.
    Good Way - used in Houdini (actually invented here as soon as I know), blender. User types just some letters he remembers. In this "VeiwMetaData" I could just type "meta" and menu will show me all options that have substring "meta" in them.

    And as general advice (anlthough, i think you already did that) - take a look onto VEX editor in houdini 16+. It is the coolest node graph editor out there
     
    Last edited by a moderator: Jan 29, 2018
  14. Elegare

    Elegare

    Joined:
    Jan 28, 2018
    Posts:
    2
    It's the first time I play with shader and I feel like the shader graph has allowed me to do some pretty nice thing. However after a few hours, I am still not able to do what I want. This is probably because I don't really know what I am doing, but I figure I could ask anyway.

    I am trying to punch some holes in a 2D texture and I want to use a shader to leave a "burn" mark around the multiple holes. So far, I was able to get the outline of the holes by comparing the original texture and the "holed" one and applying a DDXY on the result. Its seem that I am unable to change the width of my outline.

    I feel like this is not the correct way to do it. Is there a better way to do an outline ? Maybe I could move or blur the "holed" texture to get a larger outline ? Tell me what you guys think and please tell me if I am completely wrong too. :)

    Here what I got up to this point:
    upload_2018-1-28_12-37-32.png
     
    yoonitee likes this.
  15. Demkeys

    Demkeys

    Joined:
    Nov 14, 2014
    Posts:
    30
    Elegare likes this.
  16. Kink3d

    Kink3d

    Unity Technologies

    Joined:
    Nov 16, 2015
    Posts:
    45
    Shader Graph 0.1.17 Release Notes

    A new version of Shader Graph has just been released! What follows is a list of changes and fixes in this release (compared to the 0.1.9 that was released with the 18.1 beta announcement). Skip to the bottom to find out how to get it!


    Blackboard



    Introducing the Blackboard. This is the new Property window for the Shader Graph. Beyond the notable visual improvement new features include:

    • Reorderable Properties (updates exported shader property order)
    • Collapsable controls
    • Drag and drop Properties into the graph to create Property nodes

    Improved window layout



    • Separated Blackboard and Preview panels
    • Both new panels are resizable
    • Both new panels dock to the nearest window corner when window is resized
    • Relocated save button

    Slots and properties in Node Search




    When creating a new Node by dragging out an edge from an existing Node the Create Node menu will now display options for all compatible slots on compatible nodes as well as listing all individual compatible Properties.



    New Property and value types


    • HDR Color (selectable via Mode dropdown on Color node and property)
    • Slider (selectable via Mode on a Vector1 property or via its own node)
    • Integer (selectable via Mode on a Vector1 property or via its own node)
    • Boolean (selectable via Boolean property and node)

    Logic Operators




    New logic operators allow you to create branches in your graph based on comparisons, value checks and arbitrary booleans. New nodes include:
    • Comparison
    • Branch
    • And
    • Or
    • Nand
    • Not
    • Is NaN
    • Is Infinite
    • All Any

    Alpha Clip/Discard



    Alpha clip/discard can now be used on any blend mode.


    Unlit Master blend parity



    All blend operations available on the PBR Master Node are now also available on the Unlit Master Node, including Alpha Clip/Discard.


    New Nodes



    Various new nodes have been added, including:
    • Metal Reflectance (valid PBR metal color values)
    • Dielectric Specular (valid PBR specular values for dielectric materials)
    • Triplanar (triplanar texture sampling)
    • Dither (screen space dithering)

    Bug fixes and stability improvements

    And of course we have implemented numerous bug fixes and stability improvements. Some highlights include:
    • Major subgraph refactor
    • New Node menu from Spacebar hotkey
    • Fixed hanging edges caused by numerous graph invalidations
    • Fixed failed shader compilation from infinity and E values
    • Fixed incorrect UV channel for Lightweight lightmap coordinates
    • Fixed failed shader compilation when switching Master node
    • Fixed instancing support
    • Fixed sticking selection from inline UV changes
    • Upgraded Lightweight Render Pipeline version to 0.1.25
    • And much more…

    How do I get it?

    So how can you get your hands on the latest version? A few ways. First make sure you are using Unity 2018.1 beta 4 as this is required by latest version of Shader Graph. Now, either:
    • Manually update your package manifest for your project to this (the package manifest can be found in the UnityPackageManager folder inside your project):
    Code (csharp):
    1. {
    2. "registry": "https://staging-packages.unity.com",
    3. "dependencies": {
    4.   "com.unity.render-pipelines.lightweight": "0.1.28",
    5.   "com.unity.shadergraph": "0.1.17"
    6. }
    7. }

    • Go into Window > Package Manager. Then update the Lightweight package, followed by the Shader Graph package.
    • Launch Unity Hub then create a new project using the Lightweight 3d template. Then follow either of the previous steps

    Please let us know what you think!
     
  17. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    1,757
    ...aaaaand time for me to install the beta again :p

    can we do subsurface scattering on the Lightweight pipeline using shadergraph? if not could we still code our own scattering for this pipeline?
     
  18. Elegare

    Elegare

    Joined:
    Jan 28, 2018
    Posts:
    2
    Yes I did. But I did not find anything that would allow me to create an outline base on the contour of a texture. The closest one does something similar base on the position relative to the world or the object. I did not found a way to modify the position of the texture it self.
     
    Demkeys likes this.
  19. Dodafilm

    Dodafilm

    Joined:
    Nov 25, 2016
    Posts:
    1
    I use node based outside of unity and I'm very excited for this. It's looking very nice so thank you guys! Was curious if it may be possible to color code some of the categories for nodes and color darker or lighter the data generators vs the data manipulators. I've found this helpful when coming back to old projects, looking at others projects, or just learning what does what. Also, a text annotation node and a easy way to pick nodes as noted earlier(color coding may also help this). Really excited to hit the ground running!
     
  20. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    789
    This error keeps coming up for me:
    I followed the instructions but probably messed something up. Just not sure what :p

    EDIT:
    Now this too:
    I also cant delete things from the project files using my Delete key. Very strange, I will attempt to install it again.

    So yeah as I keep playing around these keys dont work for some reason. Backspace, Esc, Delete, Enter. Not sure wtf is going on.
     
    Last edited: Jan 29, 2018
  21. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    Can you try right clicking in the project view and selecting "reimport all".
     
  22. Kink3d

    Kink3d

    Unity Technologies

    Joined:
    Nov 16, 2015
    Posts:
    45
    LW pipeline does not support subsurface, but you absolutely can code your own scattering for the pipeline. Id recommend looking at the lightweight template shader for a starting point (if youre new to writing shaders for this pipeline). If you want to support this in the graph you will need to write your own master node to do so. Look at the Shader Graph Github repository for inspiration, specifically at the files PBRMasterNode.cs, LightweightPBRSubShader.cs and lightweightSubShader.template.
     
    Last edited: Jan 29, 2018
    antoripa, GameDevCouple_I and Alverik like this.
  23. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    789
    Unfortunately, I created a new project and the error has not arisen again. If it should, ill be sure to let you know ;)
     
  24. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,284
    Cool.

    But could we have an option to make the text bigger in the nodes? If you made the text 2x as big it would still fit in.

    Then when you zoomed out you could read the text better.

    Also, could you make the text "pixel aligned" when you zoom out?

    Tip:
    Actually if you have windows 10. If you go to display settings and make sure "Scale And Layout" is set to 100% it is much clearer. I had it set to 125% and the text looked a bit blurred. (OK I see this is already a noted issue with 500 votes.)

    Personally I don't think this setting should be affecting the graph view scale.

    Can I suggest a "blur" node if that's possible?
     
    Last edited: Jan 30, 2018
  25. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,366
    @Kink3d The Current Blackboard visual are still WIP isn't?
     
  26. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,284
    Here's a suggestion. Instead of having the render preview window. Just have a split screen. So you can zoom in on the final node on one half and edit other nodes in the other half.

    Also if you had more split screens you could have both a master graph and sub-graphs open at the same time. So that when editing a sub-graph you could see what effect it had on the master graph.

    Just an idea. Thanks.

    Also here's another thought. When you click on a sub-graph node. You could add some animation where you zoom into that node to see the sub-graph. That would be coooool. :cool:

    Finally, is there a full-screen mode for editing shader-graphs?
     
  27. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,284
    For my new game I want to make a kind of glowing ghost entity. Like a phantom or willow-the-wisp. A bit like Slimer from ghost busters. How would I make one?
     
  28. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    509
    I know this is a little out of topic but after updating the Lightweight RP it wreck havoc in my project.
    I'm getting : failed to open source file: 'LightweightLighting.cginc' at line 58 (on d3d11) on graphs.
    And the lightmap bake is all differnet now. HDR was disabled out of nowhere, settings changed etc.
     
  29. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    1,757
    Not recommended to update existing projects to a unfinished unreleased and likely unstable version, and the LW stuff is changing each day.
     
  30. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,284
    :eek: I hope you saved your project! This is a beta just for experimenting. But good to let them know what it does.
     
  31. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    did you also update shader graph or just LW?
     
  32. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    509
    I updated them both, reimported the project.
    Luckily it's just a test project, that's the lightweight template project, try to reproduce by adding a leightweight template from Hub and then update it.
     
  33. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,348
    Hello! is there a node for controlling how close the geometry can be rendered / rendered order on a gradual basis similar to Offset but maybe better? :p

    Having mild but annoying clipping that could be solved with nudges.
     
    Thrawn75 likes this.
  34. Steel_Arm

    Steel_Arm

    Joined:
    Apr 9, 2013
    Posts:
    22
    So, I'm running Unity 2018.1.0b4 (Personal) and... there's no option to create a shader graph?
     
    Last edited: Jan 31, 2018
  35. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    804
  36. Demkeys

    Demkeys

    Joined:
    Nov 14, 2014
    Posts:
    30
    You have to download the ShaderGraph Sample Project. On Page 1, the very first post by @Kink3d has a link to the SampleProject. Download the project and open it up. In that project, you should see the option to create a ShaderGraph.
     
  37. Steel_Arm

    Steel_Arm

    Joined:
    Apr 9, 2013
    Posts:
    22
    EDIT: Disregard the below issue. I found the solution. You have to create an SRP (in your assets) and drag and drop it into the SRP box in your project graphics settings tab. I'll leave this here in case others who are confused come across the same issue.

    Great, got that taken care, but now... When I create a shader graph, it does not render. Everything, the previews and scene objects its applied to, are invisible.

    OS: Win 7 Home Premium SP1 64-bit
    GPU: Sapphire Radeon R9 200-series (can't remember if its a 270 or 280)
     
    Last edited: Feb 1, 2018
  38. Khaeops

    Khaeops

    Joined:
    Dec 28, 2014
    Posts:
    17
    Noise nodes send to an output texture, and seemingly has fixed resolution, unless I'm missing the option to set it. Would it be possible for the output node to send different forms of output, such as float, gradient, AnimationCurve or Vectors based on input Vector2?

    Voronoi and Perlin noise are very useful when it comes to procedural generation, and it would be nice to utilise the power of the Shader Graph and the GPU to generate mass amounts of noise, as we can get far better control over the manipulation of the noise, and it's easier to work with as a visual workflow.
     
    Alverik likes this.
  39. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    534
    Will there be Headers/groups for the shader properties sometime in the future?

    Something like this - It would need a custom inspector though.

    ShaderGraph_UIDemo.png

    You could drag and drop properties in these headers/groups
     
    Ryan-Gatts likes this.
  40. Khaeops

    Khaeops

    Joined:
    Dec 28, 2014
    Posts:
    17
    @Kink3d The Shader Graph UI currently does not scale properly with the display resolution. My main machine has a 1920x1200 resolution and the graph looks fine, but my laptop at 1368x768 has a cluttered UI.
     
    GameDevCouple_I and yoonitee like this.
  41. interpol_kun

    interpol_kun

    Joined:
    Jul 28, 2016
    Posts:
    72
    What's about the background grid? It's a nice and small UX improvement, can you add that?
     
    Elegare, yoonitee and Onigiri like this.
  42. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    76
    +1 from me. also properly aligned to grid nodes(not like in animator window)
     
  43. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,284
    Add your vote here: https://feedback.unity3d.com/suggestions/operating-system-dpi-settings-su I agree this kind of needs to be sorted out for this shader graph to be usable on large screens. Even if they just sort out the DPI for the shader window only.

    For now have you tried adjusting the DPI settings/Scale and Layout in Windows?
     
    Last edited: Feb 2, 2018
  44. asethi

    asethi

    Joined:
    Jul 24, 2012
    Posts:
    16
    Hi, I'm using Unity 2018.1.0b4 version and having problems with Shader Graph in new and existing projects.
    1. Missing ShaderGraph option in Create Menu. (Snapshot Attached) -> Solved this by adding below code int manifest.json file inside UnityPackageManager folder.
    Code (CSharp):
    1. {
    2.      "registry": "https://staging-packages.unity.com",
    3.      "dependencies": {
    4.          "com.unity.render-pipelines.lightweight" : "0.1.21",
    5.          "com.unity.shadergraph" : "0.1.9"
    6.      }
    7. }
    Capture_03022018_0143.PNG
    2. Shader preview on Shader Graph is not there, but in Docs and Unity's videos it is there. (Snapshot Attached).
    Capture_03022018_0155.PNG
     
  45. CGNB

    CGNB

    Joined:
    Oct 5, 2017
    Posts:
    1
    I don't seem to get anything working, at all. I also had the same bug as @asethi, where no shader was displayed.
    I tried starting again from scratch, new project, fresh installation as described @Kink3d, and I get all sorts of errors on my console right after it being compiled and installed to my newly created project.
    I really wanted to give this a try, but this is really frustrating.

    edit: version 2018.1.0b5, and as of now same bug as before, where no shader is displayed inside the shader graph, and when assigned to a material that is assigned to an object, the object goes invisible. It's unusable for me, but I've seen the shader graph working when I opened a sample file, provided in post #1, so I'm suspecting it has to be something related to the shader graph's newest version and beta 5 compatibility?

    null texture passed to GUI.DrawTexture
    UnityEngine.GUIUtility: ProcessEvent(Int32, IntPtr)

    Screen Shot 2018-02-03 at 12.41.33.png
     
    Last edited: Feb 3, 2018
  46. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    Downloading now, looking good, I like the entire roadmap so far this year. I just hope you stick to it, you guys impress me with startups so much in the past then uhhh wtf... Unet, Tree system, you like to show off something then just drop it haha.
     
  47. Z_Kir

    Z_Kir

    Joined:
    Apr 9, 2017
    Posts:
    3
    I haven't "Shader Graph" in my project, but in LightweightAndShaderGraph it is.
     

    Attached Files:

  48. JohnSmith1915

    JohnSmith1915

    Joined:
    Apr 21, 2016
    Posts:
    143
    Is possible use this new editor to create double sided shaders?
     
  49. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    Feedback Wanted, so they can delete and entire page of it wow.
     
  50. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,366
    @Tim-C is there any preview version for the HD Shader Graph?
     
    Alverik likes this.
Thread Status:
Not open for further replies.