Search Unity

  1. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  2. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  3. If you couldn't join the live stream, take a peek at what you missed.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Feedback Wanted: Shader Graph

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

  1. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,014
    antoripa likes this.
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,014
    That has it's own issues currently (one of the reasons it's not in a public release :) )
     
  3. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    22,078
    It's probably better it is JSON since YAML parsers will understand it anyway, or should.
     
    antoripa likes this.
  4. forestrf

    forestrf

    Joined:
    Aug 28, 2010
    Posts:
    55
    Is there a way to export the graph to a .shader file?
     
  5. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    1,834
    I don't know if that's the dark interface (I use the bright theme) but this render looks better than vanilla PBR, is SRP HD > unity PBR?
     
  6. Ultra-Z

    Ultra-Z

    Joined:
    Oct 31, 2017
    Posts:
    1
    Hello.

    Will shadergraph support custom lighting? For example having the option to select light attenuation (similar as in amplify shader or shaderforge).

    Personal feedback:

    After creating the new node selection, it would be nice when hovering over a category, that all sub categories are also visible, it makes selection and readability much faster.

    thanks
    Ziggy
     
  7. taecg

    taecg

    Joined:
    Jun 14, 2014
    Posts:
    26
    upload_2018-1-12_17-7-47.png

    When I opened the project, the message was prompted, the retry was invalid, and I could open the manifest.json file after I deleted it. And there are two problems:

    1.There is no model in the example scene, and all of them are empty.

    2. there is no option to create Shader Graphic in the creation menu.
    upload_2018-1-12_17-1-37.png
    upload_2018-1-12_17-2-34.png
     
  8. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,014
    Are you behind a VPN or similar? It isn't downloading the packages so you don't have the LW pipeline and the shader graph installed.
     
  9. Kink3d

    Kink3d

    Unity Technologies

    Joined:
    Nov 16, 2015
    Posts:
    26
    @forestrf Not currently, but you can right click on the master node and select "Copy Shader" to copy the raw generated shader code to clipboard, then paste into a new shader.

    @laurentlavigne What you're seeing there is Lightweight Pipeline PBR. It may appear to be more correct than previous PBR models. It uses some more approximation in shading but the lighting calculations are more accurate.

    @Ultra-Z For custom lighting models, this is something we are going to look into but not on the current V1 roadmap. SRP creates significant challenges in this area. Good idea for UX, noted, thanks.
     
    Alverik and forestrf like this.
  10. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    845
    How to fixed??no load package.. graph.png
     
    fengyushi likes this.
  11. Pr0x1d

    Pr0x1d

    Joined:
    Mar 29, 2014
    Posts:
    5
    Hi, i wanted to try a terrain shader, as i found out none of the ways i used in other shader editors or by script doesnt work, using Control to take the splatmap from terrain, for some reason it doesnt do anything.
     
  12. Akame

    Akame

    Joined:
    Jun 11, 2013
    Posts:
    6
    Tiling doesn't seem to work as expected with procedural nodes. Seems to offset and shrink the output without actually tiling. Is this the desired behavior or just a bug with procedural nodes specifically? (See attached image)

    Also, jumping on the properties feature requests from earlier, it would be nice if we could group properties under a dropdown similar to how Substance files can specify property groups. This would allow us to organize material inspectors with lots of fields a little better and could probably be implemented by just adding an extra string field next to the property name field (or wherever things like slider min/max would be set).
     

    Attached Files:

  13. Pr0x1d

    Pr0x1d

    Joined:
    Mar 29, 2014
    Posts:
    5
    Terrain Shader
    I found one way how to do terrain shader, didnt look at passes but i know now how to get splatmap from terrain and then you can apply your textures for each channel in splatmap. (i will not show u that but u can done it easily through lerps or other ways)

    1. Step
    Add slot in your shader for splatmap.
    step1.png

    2. Step
    Find your terrain data and if u assing some textures on your terrain the splatmap should show up and then add it to the terrain material slot for your splatmap. (if splatmap doesnt show up paint on terrain with 2-4 texture and then it should)
    step2.png

    3. Step

    When u have the shader done u can paint on your terrain.
    step3.png

    +

    My terrain shader state.
    scc.png

    And now i go add height blending and normals cause i didnt add them yet :D
     
    KevinMaxon, OCASM and quixotic like this.
  14. MrJimGamer

    MrJimGamer

    Joined:
    Nov 24, 2015
    Posts:
    15
    Hello guys i started practicing the new Visual shader almost 2 days ago and i fell in love with it,i was wondering if there is a tutorial of the basics somewhere like make a texture to normal,make a grayscale tetxure to a heighmap,use a simple ramp effect ,or use the LIGHT direction for effects like fake subsurface ,but my main thing at the moment is how to convert a grayscale map to normal map or the same grayscale map to height map so we can put a bit more depth into our materials i hope the experts help me on that.Btw we will wait to see the whole package finished it will be LITTTTTT
     
  15. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    158
    To create a normal map form a height map you can use the Normal Create node.
    If you open the PartyPreview shader they provided you can see an example there yourself
    I'll also include an image of that below too.

    upload_2018-1-12_22-5-50.png

    It's a Normal Create node and the property is the height map texture input.
    This forum is for feedback so I wont make a long post helping you out here
     
    Alverik and MrJimGamer like this.
  16. MrJimGamer

    MrJimGamer

    Joined:
    Nov 24, 2015
    Posts:
    15
    Well this didnt work for me since i used a proscedural heighmap for the creation of the normal map,but tnx anyway bro.
     
  17. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,168
    Wow, this is a shock! But an awesome one!
    Just wondering, can you make super simple unlit shaders with this? Often I will need an unlit shader with just a few extras like vert colour and that type of thing for mobile apps.
    Also can you make global properties?
     
    tomekkie2 and laurentlavigne like this.
  18. tigerwoodsisao

    tigerwoodsisao

    Joined:
    Mar 8, 2015
    Posts:
    13
    Hi, I would like a function equivalent to clip or discard, but does it exist in shadergraph?
     
  19. tigerwoodsisao

    tigerwoodsisao

    Joined:
    Mar 8, 2015
    Posts:
    13
  20. interpol_kun

    interpol_kun

    Joined:
    Jul 28, 2016
    Posts:
    54
    Wow, that was a surprise, that's a very and very important tool.

    Some ideas about the UI and UX.
    • There should be some type of canvas in the background like it's in Amplify Shader Editor or UE4. It will help with the navigation and perception a lot.
    • It is obvious that nodes should have coloured labels, like, again, in Amplify/UE4. It will be easier to find your type of node quickly.
    • Lines are too thin. It can be subjective, so it should be discussed, but I prefer wider ones.
    And finally, I have a question, maybe unrelated, but important. It is possible to see Shader Graph as the not only modular window but as a tab in Unity? I know, Unity does not support global tabs yet to split your workflow, but it's a good time to start implementing some of the features because there are lots of windows now and it's difficult not to bloat your workflow with lots of local windows and tabs.
     
    Last edited: Jan 13, 2018
    elbows and JakubSmaga like this.
  21. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    611
    It has been stated that the Shader Graph is the tool to use to create shaders from 2018.1 onward.
    How would we use the shader graph to utilitze the new GPU Instancing though?

    The manual here: https://docs.unity3d.com/Manual/GPUInstancing.html
    explains it by giving examples of a handwritten shader.
    But how would we implement this in the shader graph?

    Lets say I want to make a shader in the new shader graph that allows me to set a separate texture offset, scale, as well as a tint color for each object.

    So every object would have its own a Vector4 + Color4 (or Vector2+Vector2+Color4, doesn't really matter).

    How do we use `UNITY_DEFINE_INSTANCED_PROP` / `UNITY_ACCESS_INSTANCED_PROP` in the shader graph tool?
     
  22. DanMeyer009

    DanMeyer009

    Joined:
    Sep 22, 2013
    Posts:
    17
    Have a question for you guys. I played around with the layered lit shader on an older build from SRP and noticed that it actually blended different materials that were set up. This was a wonderful change and one I agreed with. I imagine it was used to help with decreasing the amount of branching that is done internally for deferred shading. My question is, instead of creating a different shader graph for every combination of texture blending and number of textures, could you not just have a material blend node that would allow you to use a single shader graph with many individual materials? I may be wrong but wouldn't that pretty much remove ~75% of the branched shaders depending on how many individual shader graphs were present in a scene? I know every surface shader I have written has some sort of blending that I made easier with defines so I wouldn't have to make 16 some different shaders but that doesn't fix the branching I believe because every permutation would still be a branch, right? Just thought it would be really cool to combine materials based on a single shader that could still be used alone or for blending depending on the situation.

    PS. Love the direction you guys are going with this. Keep up the good work.
     
  23. mwendell

    mwendell

    Joined:
    Sep 24, 2017
    Posts:
    2
    Great start. One big request is that you support tab-completion for quick creation of nodes. For node-based interfaces, this has become a very common and expected way to work... check out houdini, katana, gaffer, nuke, etc etc. The current 'create node' menu is good for exploring what's there, but once you know what you want, it becomes too many clicks... much quicker would be to hit tab, and start typing the first letters of the node you want to quickly filter to it in a popup list. Then select and boom.

    thanks
     
    Grimreaper358 and hippocoder like this.
  24. mwendell

    mwendell

    Joined:
    Sep 24, 2017
    Posts:
    2
    You can already do this. The window that the shader graph shows up has a little tab at the top. Just drag it into any other view, and it will dock as expected.
     
  25. interpol_kun

    interpol_kun

    Joined:
    Jul 28, 2016
    Posts:
    54
    You don't understand. It will be a local tab, not global. It should be docked to other window, but it can't be a separate tab. If you are still confused check UE4 tab view. Every editor has it's own tab/window which is separate from the main window. In Unity you have no ability to create a new tab. Just to drag window on existing view, inceptor tab and etc.
     
  26. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    22,078
    I think I know what you mean, you want it to be a top-level hierarchical window instead of a child split window?
     
  27. interpol_kun

    interpol_kun

    Joined:
    Jul 28, 2016
    Posts:
    54
    Yep. Because there are so many windows now that the whole workflow is quite messy. Splitting animators, Shader Graph tools, prefab editor (in future), UI editor (in future) and current scene editor in separate tabs will be great. Modularity is good, but when there are so many windows it becomes a total hell even with a 27" monitor.
     
  28. TimbuckTato

    TimbuckTato

    Joined:
    Sep 24, 2015
    Posts:
    2
    Hi,

    Good to see this, i'm sure someone has already asked this, but how does this compare to something like amplify shader editor. I've been using that for my project and i'd like to know the positives and negatives to using one over the other.

    For example, amplify does alot of things in built for you, and you use a surface shader, can you program vertex and fragment shaders using this system?
    Does it work in a very similar to way to using shader lab (ie how easy is it to look at code and begin setting it out in nodes).
    Just generally why would I choose this over something like amplify.
    Not saying it's bad, (it's fantastic you guys are doing this!) Just trying to get the lay of the land.

    Regards,
    Matthew.
     
  29. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    22,078
    Firstly, Amplify will support this as well - they say so in their thread, so I don't think there's cause for concern. Secondly, you need to know that you're basically limiting yourself to a specific Scriptable Render Pipeline (the Light Weight one in this case).

    So it's a more complex question because shaders made with this will not work in a normal Unity project, only with Scriptable Render Pipeline.
     
  30. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    611
    As I understood it, eventually everything will be using the SRP and the current renderer will be removed, or not? So there won't be any "normal" project anymore, right? Or is that what the "Standard renderer" is. I'm confused because I thought that would be rewritten as a scriptable render loop as well?

    Also why would it be limited to a specific SRP? I thought the main goal was that shaders made in the Shader Graph tool can work in all the render loops?

    Sorry if I'm a bit out of the loop on all of this.
     
    hippocoder likes this.
  31. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    22,078
    I don't think Unity will remove the old renderer for a very long time yet, just guessing though. Certainly it's a safe bet it will be around until Unity's analytics tell them that almost nobody uses the old one or something...

    What I meant was that it would not be possible to use the Unity graph to create something that would work with legacy renderer (what everyone currently uses).
     
    Alverik likes this.
  32. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    611
    Ah I see. But why is that? Because the SRP might even have completely different blending semantics?
    Like, where writing to color backbuffer or depth won't even do what you expect it to?

    Is there a chance that a "simple" shader-graph-shader (lets say a unlit shader that simply pulses black-white based on sin(time) ) could still be used in the old "Standard Renderer"? Or will even the generated shader code be completely incompatible (but if that's the case, how can any shader even work on LD and HD render loops at the same time?)

    Would love some clarification from anyone who knows :p


    Ahh, of course. Makes sense.
    Yes, they're pretty careful with removing stuff that might be used. Old particle system, "Boo" and "UnityScript", ...
    I guess that's a sort of confirmation that the "Standard Render loop" is indeed not a rewrite but simply the current render loop.
     
  33. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,014
    There is an Unlit master node you can use :)

    We will be adding instancing support to the master nodes soon :)
     
    Alverik, antoripa, dadude123 and 3 others like this.
  34. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    200
    Will Shader Graph support Pixel Local Storage and if it is - when?
     
  35. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,014
    No. Pixel local storage is a concept that does not exist everywhere and does not make sense at a graph level. You can write a custom SRP that uses it though and have the material model be separated out.
     
    antoripa likes this.
  36. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    22,078
    I believe @Tim-C mentioned a page or so back (or somewhere) that it was a choice for them to only support SRP with the new shader graph format. I can see why it would be a waste of energy.
     
    dadude123 likes this.
  37. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,014
    The architecture allows arbitrary shader generation (which a bunch of c# classes / interfaces) if you really want to write a PBR adapter to the old render pipelines you can :), we are just not providing it out of the box. If you write a custom SRP you'll need to do this anyway to support your pipeline.
     
  38. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    22,078
    Worth waiting while for Strumpy 2 to arrive! :D
     
  39. Kink3d

    Kink3d

    Unity Technologies

    Joined:
    Nov 16, 2015
    Posts:
    26
    @Akame This is intentional so you can scale and offset the shape within "UV space". If you want to tile the UVs plug them through a "Fraction" node before entering the shape node. (This will give convert values of 1.5 > 0.5 etc so all your UV values are 0 - 1).

    @MrJimGamer More complex examples and documentation are coming. This particular problem is a tad too complicated to explain on a forum post. You need to calculate normals using derivatives (DDX and DDY nodes).

    @tigerwoodsisao Clip functionality is coming. Also Code node (this one is complicated to do correctly).
     
  40. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    1,570
    Looking forward to crack free gpu instanced tessellation shader examples in metal, work faster please :)
     
  41. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    22,078
    Get in line! I want my adaptive tessellation.... ;)
     
    Alverik likes this.
  42. Akame

    Akame

    Joined:
    Jun 11, 2013
    Posts:
    6
    @Kink3d Interesting. That feels a little redundant since the UV tiling value is essentially doing what both the offset value and the shape node's width/height values already do.
     
  43. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    158
    [Sub Graphs] - Will be useful to be able to rename the outputs in a sub graph. Gets confusing if you have a sub graph node with a lot of outputs but the names don't indicate the output type. You see all the inputs but you don't know which is connected to what output.

    Few examples
    upload_2018-1-15_11-38-28.png
     
  44. Dhialub

    Dhialub

    Joined:
    Nov 11, 2013
    Posts:
    41
    According to the compiler, the UnityEditor.ProjectWindowCallback namespace is missing (it's referenced in LightweightPipelineAsset.cs). I completely reinstalled Unity twice already, without any effect. I ended up digging in the package cache and commented out the lines referencing this namespace. The error disappeared. Any idea why it might be doing this?
     
  45. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,014
    that seems really really weird, what version of unity are you on? are you sure you have the beta of 2018.1 installed properly?
     
  46. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,014
    Agree, this is on our TODO. Note that in the current version sub graphs have some issues that can result in incorrect shader code generated, they have been resolved on our master branch.
     
    antoripa likes this.
  47. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    379
    Hi @Tim-C

    Since the next beta version of 2018.1 is going to be released within 2 days. (I hope)
    Can we expect to have Shader Graph with all the newest commits from git or are we going to have older "working" version?
    Also do you know in which beta could we expect to have working Package Manager?
     
  48. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    158
    Yea, sub graphs won't compile on my end but I still played around with them to see how they work, and give feedback if I can.
     
  49. Dhialub

    Dhialub

    Joined:
    Nov 11, 2013
    Posts:
    41
    The 2018.1b2 version.
    I suspect something is clearly wrong, just don't know what.
    Perhaps some leftover from a previous version. I tried to remove every last trace of the previous install, and it still didn't change anything.
    Screenshot (39).png

    update: I've found your post in the SRP thread and fixed the issue.

    update 2: Hidden/SRP/BlitCubeTextureFace is not supported on GLES3
    Adding #pragma exclude_renderers gles3 fixed the error
     
    Last edited: Jan 17, 2018
  50. faldor20

    faldor20

    Joined:
    Feb 9, 2017
    Posts:
    1
    Hey some of the main features i would like:
    Shader Forge does links better than any other shader editor, the lines show the number of variables being passed from one node to another and there is often a little note at the node input/output of what is moving between. As seen here VVV
    upload_2018-1-18_14-54-0.png
    I would love to see options for stencil shaders added, and of course the obvious vertex and tesselation etc
    OH and a code block to allow you to just write a bunch of code to do something... that would be great
    I don't know if some of this has been said before or not but if it has just consider it a +1 for that thing
     
    Alverik likes this.