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. Laurens-Paladin-Studios

    Laurens-Paladin-Studios

    Joined:
    Apr 25, 2015
    Posts:
    49
    Hi there Unity,

    Great shadergraph update for unity 2018.2! There is a small issue when using the Unlit Graph
    • When creating an exposed texture property reference called _MainTex, the unlit shader will not compile
    • When creating an exposed color property reference called _Color, the shader will not compile either.
    It does work when using the PBR graph

    My two cents
    Thanks Laurens
     
  2. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122
    ... And I JUST downloaded the damn update... Let me look at that
     
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    7,153
    For those following, the scaled object normal map issue has been reported to fog bugz, issue 1058965. Hopefully it'll make it's way to the issue tracker soon.
     
  4. Laurens-Paladin-Studios

    Laurens-Paladin-Studios

    Joined:
    Apr 25, 2015
    Posts:
    49
    One more thing I noticed and reported as a bug, I did see someone else posting it on this forum before:
    • When using HDR in shadergraph it will not bake onto other surfaces.
    Bug.JPG

    On the left is the Shadergraph shader and on the right is the standard shader. As you can see, the standard shader cube bakes light onto the groundplane, while the shadergraph shader with almost the same properties does not.
     
    Blitzkriegmlg and konsic like this.
  5. rizu

    rizu

    Joined:
    Oct 8, 2013
    Posts:
    1,158
    I'm curious what are the plans for Shader Graph and HDRP Forward Only mode? Atm Forward Only doesn't give you proper results for shaders build with Shader Graph but regular HDRP shaders work there just fine.
     
  6. minhdaubu2

    minhdaubu2

    Joined:
    Jun 10, 2014
    Posts:
    69
    Hi, is there a way to make shader graph material use custom Editor?

    CustomEditor "MyEditor"
     
  7. dandepeched

    dandepeched

    Joined:
    Feb 22, 2016
    Posts:
    30
    Some bugs:

    1. Shader Graphs still cannot be rendered in Editor if .NET 4.x Equivalent is selected in Player Settings.
    Error in inspector:
    Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)

    Error in console:
    Shader compilation error in graph at line 5 (on ):
    Parse error: syntax error, unexpected ',', expecting ')'


    2. In new update SubShader cannot not be compiled within shader if it has its own properties. An errors like following appears during compilation:
    Shader error in 'ToonUnlit': 'sg_ToonShadowSub_E57DE893': cannot implicitly convert from 'sampler2D' to 'struct SurfaceDescriptionInputs' at line 151 (on gles)
    Compiling Vertex program
    Platform defines: UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 SHADER_API_MOBILE UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING

    Shader error in 'ToonUnlit': 'sg_ToonShadowSub_E57DE893': cannot implicitly convert from 'Texture2D<float4>' to 'SamplerState' at line 151 (on gles3)
    Compiling Vertex program
    Platform defines: UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER SHADER_API_MOBILE UNITY_HARDWARE_TIER1 UNITY_COLORSPACE_GAMMA UNITY_LIGHTMAP_DLDR_ENCODING


    3. Numerous warnings like following are printed in console during shader compilation:
    Shader warning in 'ToonUnlit': conversion from larger type to smaller, possible loss of data at /Users/Dan/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.render-pipelines.core@2.0.4-preview.1/CoreRP/ShaderLibrary/BSDF.hlsl(105) (on gles3)
    Compiling Vertex program
    Platform defines: UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER SHADER_API_MOBILE UNITY_HARDWARE_TIER1 UNITY_COLORSPACE_GAMMA UNITY_LIGHTMAP_DLDR_ENCODING
     
    MythrilMan51 and ChrisPie like this.
  8. xrad

    xrad

    Joined:
    Dec 1, 2016
    Posts:
    2
    Quick question. When I apply normal map and I scale the object to some bigger size, the normal map loses its effect and only black patches are visible as seen on the pics:

    normal.JPG broken.JPG
    How do I fix this?
     
  9. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    483
    Yeah normal maps are a known issue, what you can do for now is set normal map intensity to something really low, like 0.05, or maybe even lower like 0.005.
     
  10. Clyde_Coulter

    Clyde_Coulter

    Joined:
    Jul 14, 2014
    Posts:
    57
    With Unity 2018.2.0f2 and Shader Graph 2.0.5 (preview)
    I'm having a problem with the UI in the Shader Graph. When selecting a value to change, it is unresponsive until I click away from it, then any and all values that I have clicked on before become active when "hovering" over them.
    Also, I cannot get anything but the magenta color to show in the final output. (EDIT: DUH, I needed to create the HDR Pipeline Resource and assign it to Project->Graphics)
    My system is as follows:
    Microsoft Windows 10 Home version 10.0.17134
    Intel 6 core processor
    32GB Ram
    NVidia GTX 1080 Graphics 8GB Ram
    Unity 2018.2.0f2
    HD Render Pipeline 2.0.5 (preview)
     

    Attached Files:

    Last edited: Jul 12, 2018
  11. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    3,980
    I'm unsure what these errors mean. I don't think the scripting runtime will have any impact on the GPU. Also, do you have any idea what code this parse error comes from? It does not look like an error from the C# compiler.
     
  12. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    975
    Unity 2018.2 and shadergraph 2.0.5, I get the error

    Assertion failed on expression: 'success'
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

    Created a new PBR graph and added "Sample Texture 2D" node... connected to Albedo and selected texture. Preview stays magenta...

    Project is Lightweight RP for VR, if that matters...

    Anyone knows what to do?

    Thanks :)
     
  13. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    804
  14. francois85

    francois85

    Joined:
    Aug 11, 2015
    Posts:
    644
  15. francois85

    francois85

    Joined:
    Aug 11, 2015
    Posts:
    644
    Here is the issue vote for a fix
    https://issuetracker.unity3d.com/is...rmal-maps-turns-black-when-scaling-up-objects
     
  16. sand_lantern

    sand_lantern

    Joined:
    Sep 15, 2017
    Posts:
    52
    Did you make any more progress on this? I was pretty interested in the application. I looked around for some information on writing master nodes this morning but it doesn't seem like a lot of resources exist yet.
     
    Last edited: Jul 13, 2018
  17. wyatttt

    wyatttt

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    260
    @sewy Are you using HDRP or have the HDRP package included in your project?
     
  18. poa123

    poa123

    Joined:
    Jul 13, 2018
    Posts:
    22
    Newbie here with some questions... i´ve read the hole thread, but it is not clear to me.

    1) In the Render Pipeline (HD) it will NOT be possible to write the "source code" for Surface Shaders and Compute Shaders? I cannot see how Shader Graph can replace it to create complex shader behavior (hope to be wrong).

    2) There are plans to create other shader types besides PBR and Unlit? I am thinking about UI, Post Processing, Deferred Decals and Volume shaders.

    3) I have read somewhere about a "Stack Lit" shader type in development for 2018.3? What is that?

    4) There are some info (docs) regarding write custom nodes to be used on Shader Graph?

    Thanks a lot, Unity Community is awesome!
     
  19. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,299
    I cant speak about other kinds of shaders but I'm using some compute shaders (in the old, usual way) with HD pipeline without any issues.
     
  20. minhdaubu2

    minhdaubu2

    Joined:
    Jun 10, 2014
    Posts:
    69
    Does anybody know how to use CustomEditor for Shader Graph's shader???
     
  21. OfficialHermie

    OfficialHermie

    Joined:
    Oct 12, 2012
    Posts:
    457
    Does ShaderGraph act as a texture packer?
    When you use the HDRP Lit Shader, it requires you to have the Base Color in RGB channels and Opacity in Alpha channel.
    Currently I do this in an external program.
    Can the ShaderGraph do this?
     
  22. RyanJEC

    RyanJEC

    Joined:
    Jan 13, 2017
    Posts:
    32
    Can we get a gradient property input for shadergraph?
     
  23. GlitchshopSweeper

    GlitchshopSweeper

    Joined:
    Jan 31, 2015
    Posts:
    1
    Hi, I am trying to create a toon shader with outline. With shader code I would do two passes:
    - render outline by extruding positions in normal direction and using simple colour for the fragment shader
    - render front faces with unmodified vertex positions and using some model texture modifications

    For front faces it works superb, blend node can be used to combine shadows and texture. Huge thumbs up! :D
    To move vertices in their normal direction, no problem with 2018.2. But how do I extrude back faces and render them with a solid colour and after that make another pass with unmodified vertices with texture and toon shade blend?

    To put it another way, how to make two passes, one for back faces and one for front faces?

    For reference, this free toon shader does the trick.

    Edit:
    I can not use two sided on master and use "Is Front Face" node for branching with vertex extrude. It just refuses connection to position.
     
    Last edited: Jul 14, 2018
  24. HopelessHyena

    HopelessHyena

    Joined:
    May 26, 2015
    Posts:
    18
    Hi @ssartell Love the shader. Would you mind explaining what you did to map the _CameraOpaqueTexture correctly? I have been able to access the texture but I can't work out how to correctly position it on the object. Any help would be greatly appreciated, as I am also trying to create a water shader similar to yours. Many thanks in advance!
     
  25. Soaryn

    Soaryn

    Joined:
    Apr 17, 2015
    Posts:
    210
    On more towards the UX side, How much of a chance of adding node snapping and edge anchors?

    It is one of the few things I actually really liked with Unreal's graph systems where you could align multiple nodes cleanly, as well as anchor a edge so you could easily connect and disconnect a system without having to scroll to the other nodes.

    Having multiple of these lines have a pixel of deviance or turning is actually really bothering :(
     
    awesomedata likes this.
  26. poa123

    poa123

    Joined:
    Jul 13, 2018
    Posts:
    22
    Hi guys, please help!

    Trying using Alpha and AlphaClipThreshold to animate a dissolve effect...

    1) Through Package Manager, update HD OR LW Pipeline AND Shader Graph.
    2) Create a new Shader Graph (PBR). Connect a Noise (size 30) node to Alpha.
    3) Create a Time node and connect Sine to a Remap node. Connect to AlphaClipThreshold.
    4) RESULT IN LW: effect works in the graph editor, but not in the scene.
    RESULT IN HD: not working in graph editor nor scene.

    Is it supposed to be working?

    EDIT: the problem in scene was with my UV map. It is working now in "Play Mode".

    The editor does not show the Alpha animation in HD Pipe, only in LW.
     

    Attached Files:

    Last edited: Jul 15, 2018
  27. tinyant

    tinyant

    Joined:
    Aug 28, 2015
    Posts:
    103
    is there a way to look up shader code created by Shader Graph?
     
  28. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    550
    Right click the Master Node - Show Generated Code or Copy Shader then paste it in your text editor.
     
    tinyant likes this.
  29. PixelMind

    PixelMind

    Joined:
    Aug 16, 2013
    Posts:
    100
    (Used version 2.0.5-preview from Package Manager)

    Quick usability suggestion: It would be great if automatic compiling could be disabled. It's really slow and tedious to work with larger graphs simply because any change to the graph results in a re-compile of the shader you're working on.
    Simple toggle to on / off somewhere would suffice. Like automatic lightmap generation can be toggled on and off. If auto compile is turned off perhaps then there could be a button to compile manually.
    This alone would probably double my work speed.

    Another usability thing would be to be able pan and zoom on the graph while making a connection (holding left mouse button). I'm often trying to connect 2 nodes together that are far apart so not being able to pan and zoom is somewhat annoying.
    Same for dragging nodes around. Currently panning works while dragging nodes but the movement is bugged as the node you're moving moves to opposite direction.

    Support for receiving decals on HDRP graphs would be nice but I'm assuming its coming later.

    The graph works great otherwise. Haven't had any major issues so far.
    Especially love the fact that writing your own nodes and therefore extending the editor is really straightforward. I'd imagine there will be open source additional node packs eventually when more developers start to use them.
     
    Salzian and awesomedata like this.
  30. Vak_HD

    Vak_HD

    Joined:
    Aug 6, 2016
    Posts:
    11
    Hello,

    I am using the LWRP version 2.0.5 in 2018.2 on a Mac and for all pretty much all my materials I am getting a warning message on the console stating:

    Metal: Fragment shader missing buffer binding at index 3 (_LightIndexBuffer / LightweightPipeline/Standard (Simple Lighting))

    Metal: Fragment shader missing buffer binding at index 3 (_LightIndexBuffer / LightweightPipeline/Standard (Physically Based))

    and also I don't get any material preview in the material viewport,

    Anyone know why/what I can do to fix this?

    I also am having issues with the normal map turning black when scaling up meshes when using the shader graph as well.
     

    Attached Files:

  31. Incomitatum

    Incomitatum

    Joined:
    Jan 30, 2015
    Posts:
    7
    I need to be able to use Shader Graph to create Materials that I can to Sprites, that are Lit (having normals or not). Also Supporting access to the multiple alpha channels in a TIF file is essential.
     
  32. Giles-Coope

    Giles-Coope

    Joined:
    Jan 5, 2015
    Posts:
    48
    I've started a collection here already, and will be adding more as I create them.

    https://github.com/gilescoope/shader-graph-nodes
     
    PixelMind likes this.
  33. Dudledok

    Dudledok

    Joined:
    Oct 24, 2013
    Posts:
    110
    Is there an example of how _CameraOpaqueTexture is meant to be used to replace a GrabPass?
     
  34. TheBricktop

    TheBricktop

    Joined:
    Sep 3, 2012
    Posts:
    25
    unity 2018.2 : cant connect vector3 output to the position input, its not clear why upload_2018-7-17_14-38-14.png
     
  35. Giles-Coope

    Giles-Coope

    Joined:
    Jan 5, 2015
    Posts:
    48
    I think it also depends what you are trying to connect. The vertex position is calculated before the fragment shader executes, so certain operations, such as DDX and fwidth aren't available. Thus any path which uses these shouldn't connect to the position input. There are some nodes that it's unclear why they won't connect, such as camera > position. And there could be a better indication of why your current connection isn't working.
     
  36. MR-Heavy

    MR-Heavy

    Joined:
    Jan 1, 2016
    Posts:
    14
    I'm try to use Graphics.Blit(Texture2D, RenderTexture, Material);
    With standard "unlit" shaders - work 100%, with Shader graph's "unlit" - nope.
    Seems problem somewhere with something from this: "ZTest Always Cull Off ZWrite Off".
    Anyone know how to fix it? (unpainful way plz)
     
  37. Demkeys

    Demkeys

    Joined:
    Nov 14, 2014
    Posts:
    30
    Hey, I'm not sure how to explain this in a Bug Report so I decided to post it here. I'm not sure if others are having this issue as well. I'm using Unity 2018.2.0f2 and Shader Graph 2.0.5-preview.
    So in the attached pic I've highlighted a field. When I place my mouse cursor over 'X' the cursor changes to a mouse cursor with two arrows on either side. When I click and move the cursor left or right, the field value doesn't change. And when I release the mouse button, the cursor doesn't change. It remains stuck at the same cursor. After that, when I bring the mouse cursor directly above 'X' and move the cursor up and down the field's value changes. Keep in mind, at the point, I'm no longer holding down the mouse button, I've already let go of it. Yet, when I move the cursor directly above 'X' the value changes, and anywhere outside 'X', the value doesn't change. This issue isn't particular to this field or this node. It happens with other nodes too.
    Anyone else experiencing this issue?

    EDIT: Shortly after making this post I realized how to reproduce the problem. Steps:
    • Create a node. For example, Ellipse.
    • Move your mouse cursor over the Width field, where it says X.
    • Left click and release the mouse button over the X.
    • Then move your mouse cursor out of it. The cursor doesn't change.
    • Now if you move your mouse cursor over the X again, and just move the mouse up and down (no need to click), the value changes.

    screencap.png
     
    Last edited: Jul 18, 2018
  38. Zyhael

    Zyhael

    Joined:
    May 22, 2018
    Posts:
    1
    Is it possible to have some form of shadow catching on unlit shader graph aka diffuse with shadows? I've added a lambertian algorithm to my unlit shader but it would be nice to be able to include shadows (I know it's called unlit, but I was expecting it would be the manual type of shader or the basic shader where if you want a custom pbr type shader you can make it there else use the built in pbr shader). I hope I'm making sense.

    Basically an Unlit + lambert formula + shadows = custom diffuse. (for mobile purposes) I would very much like to avoid pbr for this project. Though if there wouldn't be something like it, I'd be forced to test using pbr or to write my own shader.

    Just want to know if there are plans for this or if something like this is possible. Thank you.
     
  39. dandepeched

    dandepeched

    Joined:
    Feb 22, 2016
    Posts:
    30
    @JoshPeterson , I do not know what this error means neither. It appears on different workstations, so I believe it is not related to GPU. Changing scripting runtime fixes it, so that should be a reason.
    Parse error appears in Unity Editor Console when saving/compiling Shader Graph.

    @Carpe-Denius , English
     
  40. Dudledok

    Dudledok

    Joined:
    Oct 24, 2013
    Posts:
    110
    I get this as well. I expected it to behave like in the inspector so you could click and drag to change the value, but if your cursor leaves the value it stops changing and hovering back over starts changing it again.

    Fixed in future release: https://issuetracker.unity3d.com/is...n-mouse-hover-after-double-clicking-the-value
     
    Demkeys likes this.
  41. Demkeys

    Demkeys

    Joined:
    Nov 14, 2014
    Posts:
    30
    Ah I see. Thanks! I should've checked the issuetracker first. That's my bad.
     
  42. Laurens-Paladin-Studios

    Laurens-Paladin-Studios

    Joined:
    Apr 25, 2015
    Posts:
    49
    Hi there @wyatttt @JoshPeterson

    I encountered a couple of bugs mentioned by me previously:
    • Making an Unlit shader graph shader and naming a Texture reference "_MainTex" or a color reference "_Color" breaks the shader
    • High emissive values do not get baked onto other surfaces using a shadergraph shader
    • Shadows will not render correctly using an alpha tested shader in LWRP shadergraph
    • GI will not bake correctly using an alpha clipped material (shadergraph or standard LWRP shader)
    It would be great to hear if any of these are under the radar or not.

    Thank you in advance
    Laurens
     
    Last edited: Jul 18, 2018
  43. RyanJEC

    RyanJEC

    Joined:
    Jan 13, 2017
    Posts:
    32
    Is there an eta on when we will be able to create custom master nodes?
     
  44. LukeZeches

    LukeZeches

    Joined:
    Jul 12, 2018
    Posts:
    5
    Last edited: Jul 18, 2018
  45. wyatttt

    wyatttt

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    260
    Hey @Laurens-Paladin-Studios,
    • Shadows will not render correctly using an alpha tested shader in LWRP shadergraph
      • This is when using a material made from a ShaderGraph using LWRP right? And not just the standard LWRP material?
      • We are aware of and have a fix for alpha clipped shaders not generating correct depth and shadow passes
        • I believe that is awaiting a merge to master on GitHub
      • Can you provide an image showcasing the issue? So I can determine if this is a new issue or the one that has been fixed
    • GI will not bake correctly using an alpha clipped material (shadergraph or standard LWRP shader)
      • Do you see similar results with baking GI as you do with real-time lighting from the above issue?
        • IE. shadows are still rendered/baked even though pixels are clipped OR clipped pixels are blocking shadows from being seen on screen?
      • I can check to see if the branch for the above issue fixes the GI issue
    Are you using the ScriptableRenderPipeline repo? If so, which branch?

    I will get back to you on the other two issues you provided.

    Thanks,
    Wyatt
     
  46. Laurens-Paladin-Studios

    Laurens-Paladin-Studios

    Joined:
    Apr 25, 2015
    Posts:
    49
    Hi there Wyatt, thank you for the response!

    Thats right! Using the standard LWRP shader the realtime shadow works correctly: RealitmeShadowClipped_GraphAndStandard.JPG
    Left is the shadergraph shader and right is the standard lightweight shader
    It might be the same issue, only with this issue both the standard Lightweight shader and the Shadergraph version of that shader do not bake GI correctly.
    BakedShadowGIClipped_GraphAndStandard.JPG
    This is the exact scene as the previous image, only with light being baked, for me this looks like the GI and the shadow are baked incorrectly in both cases

    If you compare this with baked lighting using the standard rendering pipeline (With the standard shader)
    BakedGiAlphaClip_UnityRP.JPG
    This is the expected result :)

    Currently I am using 2.0.4 preview, so im not on any specific git repo. When typing this reply though i switched to 3.0 to check if it might have been fixed, but it looks like it hasn't yet and there is another error at the realtime shadow for the shadergraph shader:
    One more test using 3.0.0.jpg

    If you want me to test a specific update i am willing to help out:)

    Thank you very much
    Laurens
     
  47. Cogsy

    Cogsy

    Joined:
    May 16, 2018
    Posts:
    3
    Which type of shader graph is the most efficient to use with the LWRP on mobile devices? PBR, sub, or unlit? are either of these resource heavy?

    Thanks
     
  48. wyatttt

    wyatttt

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    260
    @Laurens-Paladin-Studios

    Thank you for the photos! For the last image, the issue on the lower left has the fix I was talking about. As for the GI, since it doesn't work with either material/shader, it might be a pipeline issue. I'll check the status of that issue with our team.
     
  49. wyatttt

    wyatttt

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    260
    @Cogsy

    • Unlit would be more efficient.
    • Sub = Subgraph and is a graph type you can use to encapsulate regions of your graph and reuse them. Creating a subgraph out of a portion of your graph creates a Subgraph asset and makes that available as a new graph node
    • PBR = the physically based rendered version which takes into account lighting, metallicness, smoothness, etc. and involves more calculations than Unlit
     
  50. MR-Heavy

    MR-Heavy

    Joined:
    Jan 1, 2016
    Posts:
    14
    Hi there @wyatttt
    Is it any good way to force "Graphics.Blit(Texture2D, RenderTexture, Material); " work with shader graph's unlit shader?
     
Thread Status:
Not open for further replies.