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. hogwash

    hogwash

    Joined:
    Oct 12, 2012
    Posts:
    115
    The announcement seemed to imply that the shader graph system now supports the HD render pipeline. Is that correct?
     
    tertle likes this.
  2. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    How do you access _TransparencyLM in the shader graph, or is it because only Lightweight is supported currently that it's not available?
     
  3. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,284
    That's a reason why I think you should be able to import/export out the graph as text like XML or something. So that people could make shader graphs with scripts or batches etc. Also if someone was creating a little program that converts legacy shaders into the new shader graph system, an intermediate step of creating an XML file of the shader might be useful. Of course that depends how `open' the shader format should be.

    A question: What graphics card specifications will be required for the new shader system? I can imagine adding too many nodes would easily overwhelm many laptop graphics cards. Will it tell you the minimum spec for particular graphs?
     
    Last edited: Feb 28, 2018
  4. DanMeyer009

    DanMeyer009

    Joined:
    Sep 22, 2013
    Posts:
    18
    I've been trying to keep up with the eight pages of remarks in this thread but I may have missed it. I think having the overall instruction count for the shader graph would be an important performance marker. It may help pinpoint bottlenecks further in production. Otherwise I think it looks great, looking forward to trying it out with HD.
     
    awesomedata likes this.
  5. Ofx360

    Ofx360

    Joined:
    Apr 30, 2013
    Posts:
    66
    IIRC a shader graph is just some JSON. Pretty sure thats what it generated when i tried it out at the beginning of the beta. You could probably check for yourself, let me know if that's correct.

    Edit: Looks like it is JSON - https://github.com/UnityTechnologie...ph_ExampleLibrary_Project/Assets/ShaderGraphs
     
    Last edited: Mar 1, 2018
  6. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    124
    Shader Graph disappeared from Package Manager. How it can be installed now?
     
  7. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    Try installing 'Render-pipelines.lightweight' Version 1.0.0 (Beta)
     
  8. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    Dependencies have been changed. You will pull it in automatically if you add LW like Andy suggested.
     
  9. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    535
    I would like to see this as well.


    Right-click the sphere and select what you want or a custom mesh. The Quad will work as your plane.

    upload_2018-3-1_9-2-0.png
     
    awesomedata likes this.
  10. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    535
    Will the properties of these two nodes be exposed in the inspector so they can be changed at any time?
    Select different options from the dropdown and edit the sliders without having to go into the shader every time.

    upload_2018-3-1_9-6-53.png
     
  11. FreeGameDev

    FreeGameDev

    Joined:
    Dec 1, 2015
    Posts:
    65
    FEEDBACK POST (2018.1.09b)

    I am currently going through all the UE4 sub-graphs and trying to implement some of them in Unity shader-graph. Instead of a million posts I will just keep updating this post as to what I find, in the hopes it will help you out in features and debugging. I will also add the sub-shaders I create in the link below, in case anyone wants to use them. (I would also be interested in any other shader-graphs that have been ported)

    Commendation:

    - Love the shader-graph. Great tool.
    -shader-graph is much faster loading and showing live preview than ue4.
    - I like the property inputs/naming.

    Features Needed: (In somewhat order of importance)
    - Nested sub-shader graphs. (Helps to build up tools and simplify more complex graphs.
    - Configurable input. (middle mouse button is not good for laptop users)
    - Particle Color Node
    - Particle Direction Node
    - Particle Motion Blue Fade Node
    - Particle Radius Node
    - Particle Random Node
    - Particle Relative Time Node
    - Particle Size Node
    - Particle Speed Node

    Would be nice features: (But not high priority)

    - Custom node. (where you can add your own shader code referencing the inputs. (ex: max(Input_1, Input_2)) <- this would run this code with the inputs.
    - Description box for sub-shader and main shader. (So you can explain what the shader/sub-shader does)
    - A way to be able to simply change the input property type in a sub-shader. (Right now to go from vector3 to texture2d you need to create a new property, delete the old node and re-hookup the new property node.) In the blackboard side it would be nice to just have a drop-down to change the type)
    - Would be nice to be able to label outputs.

    Bugs:
    - sometimes node connection lines are not deleted when a node is deleted. (only happened once)

    Shader-graph nodes can be found here. (Check once in awhile as I update them.)
     
    Last edited: Mar 2, 2018
  12. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    535
    This is not a bug. The "Channel Mask" node is dynamic. its channel outputs are the same value as input

    So if you add a vector 1 it will only output one channel plus the "Everything" mode
    - Vector 1/equavilent = 1 output + Everything
    - Vector 2/equavilent = 2 outputs + Everything etc

    upload_2018-3-1_12-27-18.png

    More images in the spoiler section below (Not to take up space on the page)

    upload_2018-3-1_12-27-43.png

    upload_2018-3-1_12-27-57.png

    upload_2018-3-1_12-28-10.png

    It used to show all channels in the earlier versions but got changed sometime along the line.
     
  13. Andor14

    Andor14

    Joined:
    Oct 14, 2017
    Posts:
    2
    Quick question; how do you reference an object's normals? For the triplaner projection node.
     
  14. FreeGameDev

    FreeGameDev

    Joined:
    Dec 1, 2015
    Posts:
    65
    Ahh perfect thank you!
     
    Last edited: Mar 2, 2018
  15. KUFgoddess

    KUFgoddess

    Joined:
    Apr 2, 2015
    Posts:
    26
    anyone know if its user friendly or not? Could a beginner with some tutorials easily create shaders?
     
  16. FreeGameDev

    FreeGameDev

    Joined:
    Dec 1, 2015
    Posts:
    65
    So far I am finding it fairly similar to ue4's material editor. So, yes, it is fairly easy.
     
  17. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,233
    recursive and Peter77 like this.
  18. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    chiapet1021 and elbows like this.
  19. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    People are using it to make Shaders; so I would say that it is user friendly. :)
     
    KUFgoddess likes this.
  20. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    Did you try the Normal Vector node in Object space?
     

    Attached Files:

  21. manran

    manran

    Joined:
    Jan 30, 2014
    Posts:
    34
    Hello guys , i have Unity 2018.1 .0b9 , can i now implement shader graph to my project? If yes how? I've already installed the LWRP from the package manager but the shader graph menu creation is not here. Do i need to do something else? Thank
     
  22. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    535
    @manran Looks like shader graph is now embedded in the render pipe, so you might already have it installed if you installed lightweight 1.0.0 Beta.

    The menu items to create a shader got moved to here

    Right click project windows or select create Button (Create > Shader > PBR Graph/Unlit graph and Sub Graph)

    If it's not showing up then you can install the Shader Graph from the Package manager and it should show up

    upload_2018-3-2_16-57-54.png
     
    manran likes this.
  23. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    535
    No problem man. Appreciate the sub graphs you made. I made a few material functions/sub graphs from UE4 as well as some custom ones when I was heavily testing Shader Graph. Will probably share those as well, though some are kind of specific but someone might find them useful.
     
  24. Andor14

    Andor14

    Joined:
    Oct 14, 2017
    Posts:
    2
    Ah that was exactly what i needed. Thanks a lot!
     
  25. manran

    manran

    Joined:
    Jan 30, 2014
    Posts:
    34
    Thank you so muck i was searching for "shader graph" so it became PBR graph etc. but i get a new issue now . everything is pink, i've tried on my project, and on a new project but no success. what could be the cause?
     

    Attached Files:

    Last edited: Mar 3, 2018
  26. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    535
    Ah yes, Now you need to create and assign a render pipeline (In this case the lightweight one).

    upload_2018-3-3_10-57-54.png

    then assign it to the Graphics setting

    Edit > Project Settings > Graphics

    upload_2018-3-3_11-1-46.png
     
    manran, Demkeys and Andy-Touch like this.
  27. FreeGameDev

    FreeGameDev

    Joined:
    Dec 1, 2015
    Posts:
    65
    Is it possible to make a multi-pass material with shader-graph? If so, how?
    Thanks.
     
  28. coasterfreak_unity

    coasterfreak_unity

    Joined:
    Feb 20, 2018
    Posts:
    7
    I might have found a bug with the Render Texture in combination with the shader graph. If I use an Unlit/Texture or LightweightPipeline/Standard Unlit shader, a texture can be copied to a Render Texture by Graphics.Blit. An Unlit shader graph with a connected texture only outputs a black texture using the same method.
     
  29. FelyksGoHigher

    FelyksGoHigher

    Joined:
    Mar 5, 2018
    Posts:
    1
    I am unable to use Shader Graph on my home computer.
    The issue is simple : I cannot see the result of the shader it self in the PBR Master block. And obviously, the material using that shader also doesn't work (objects are completely invisible).

    At first I thought it might be the alpha or something but whatever I set, nothing is visible.

    Any idea what could be causing this?

    I testing with 2018.1.0b9. Thanks.
     
  30. FreeGameDev

    FreeGameDev

    Joined:
    Dec 1, 2015
    Posts:
    65
    Another question. Is Camera Direction in tangent space? If so, can anyone tell my why this is not working? It is a bumpoffset or ParallaxMapping node I am working on. It should offset the uv coords based on the heightmap and camera direction.
     

    Attached Files:

  31. MathiasNorregaard

    MathiasNorregaard

    Joined:
    Mar 1, 2017
    Posts:
    5
    Hi, how do you construct a Vector 2 dynamically? Like if you have value foo and value bar, can I feed them into a node that turns it into one Vector 2 object? For me it would make sense if you could drag straight into a Input/Basic/Vector 2 node. It seems that node is for constant values, but then it could be used for both constants and mutables.
     
  32. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    Use a 'Combine' Node. :)
     
  33. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    Do you have a Lightweight Render Pipeline Asset applied to the SRP Settings in Graphics Settings?
     
  34. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    638
    Please, implement vertex material paintig for assets and landscape

    For example

     
  35. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
  36. hwaet

    hwaet

    Joined:
    Mar 21, 2015
    Posts:
    23
    @Andy-Touch, would you happen to have any info to share on creating custom nodes? I'm super curious about the abilities we'll get from that.
     
  37. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    Nope, I have not seen the API yet for creating custom nodes.
    However, Shader Graph can be downloaded from this GitHub Repository (https://github.com/Unity-Technologies/ShaderGraph) and you could take a look at the code for the built-in nodes. No idea if they are representative of the custom node API but it is probably a good starting place to dive into. :)
     
    Last edited: Mar 6, 2018
  38. Giles-Coope

    Giles-Coope

    Joined:
    Jan 5, 2015
    Posts:
    48
    Hi there, a couple of questions, I'm using the lightweight pipeline.

    - if I want to do a depth test, testing against the z-buffer, do I have to explicitly have to mark "depth texture" in the asset settings? Is this slower than a simple depth test would have been in the old pipeline?
    - is it possible to dynamically set whether a shader will write to the depth buffer or not?
    - is it possible to change the shader position in the render queue, beyond just switching between transparent and opaque?
    - at the moment it seems dynamic batching is disabled, is this deliberate or will it come back?
    - is it possible to specify external names of properties, so they can be more easily set from code, for example by the Material.SetTexture() method. at the moment properties have external names like "Texture_329A7734" and "Cubemap_F82009E"
     
  39. manran

    manran

    Joined:
    Jan 30, 2014
    Posts:
    34
    Anyone has an idea on how they created the volume fog in the BOOK of ThE DEAD demo, with the
    HD RP ? Thanks
     
  40. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    416
    They're using the old Atmospheric Scattering from The Blacksmith demo.
     
  41. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,357
    And as far as I know plan to do a proper version at some point.
     
  42. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    416
  43. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    638
  44. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    416
    konsic likes this.
  45. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,233
    Well their emphasis is on unifying as much as possible in the HD pipe and that very much includes sky/fog atmospheric scattering, local fog, and the various kind of lights. Given that the area lights research they did was a big part of that volumetric lighting (aka Adam Volumetric Fog) you mention, and the polygonal area lights are part of the HD pipeline, it is quite reasonable to assume that broadly equivalent volumetric lighting features will end up in the HD pipeline eventually. How much of the existing code and concepts are ported over from that one to the HD pipeline to make this happen remains to be seen. And they've been focussed on lots of other stuff in the HD pipeline so far, so talk of timescales has been kept suitably vague. Long term I would expect the modern, unified and flexible nature of the HD pipeline to enable us all to get quite a bit more out of the lighting and volumetric side of things than we've been able to so far using various examples provided in recent years by way of sample code from impressive demo effects. I'm very much looking forward to seeing this stuff evolve as part of a pipeline rather than being isolated projects that dont encourage integration and compatibility.
     
    Flurgle, konsic and JakubSmaga like this.
  46. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    229
    konsic likes this.
  47. FreeGameDev

    FreeGameDev

    Joined:
    Dec 1, 2015
    Posts:
    65
    I have been beta testing as much as possible. Currently trying foliage. I am having a problem creating proper foliage with proper shadow casting. Is there any way with the current version? Is cutout needed? I have pretty well tried everything.

    Thanks
     
  48. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,512
    I tried the shader graph.

    1. Is it possible to see and modify the cg shader code generated ? All I can see is the asm code by compiling the shader - not what I need.
    2. When importing a mesh to preview the shader in realtime ( lower right corner ) I cannot pan the mesh position in the preview window - try importing the Arches mesh, you cannot see it entirely. Can I pan the mesh - do you plan to add this feature ?
    3. Feeding an RGBA (4) to an Albedo (3) creates an annoying feeling, further enhanced by not being able to see the code that shader graph generates. Back in the day, the grandfather of the Shader graph, Strumpy editor or something like that, generated unoptimized code for mobile, but at least it could be inspected and fixed.
    4. Create a new shader graph and select it in the project panel, go to the inspector and click the new shiny preset button - bang, Unity crashes.

    I would appreciate an answer on 1 and 2, thanks.
     
  49. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    Right Click the Master Node and select 'Copy Shader'.
    Paste it into a text editor.

    However, modifying and saving it won't apply the changes back to the Shader Graph.
     
  50. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    Nice! I haven't tried Probuilder/Polybrush at all yet but I can't wait to play around with it in combination with Shader Graph. :) Maybe that will be the next example project I put together...
     
    Adam-Bailey likes this.
Thread Status:
Not open for further replies.