Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Feedback Wanted: Shader Graph

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

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

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    483
    wait scratch that. Can I get someone to double-check the reflections with a material that uses a graph-based shader?

    Set the material albedo to white, metallic to 1 and smoothness to 1. Make sure you have a skybox or reflection probe or whatever that's got enough contrast to show straight edges for ease of visibility.

    This is what I'm getting. On the quad it's easy to see the normals aren't aligned along the edge, on the flat plane it's distorting the reflections (it should appear as a nice mirror surface).
    lol_normals.png

    I was going mad trying to do an ocean with high smoothness and the reflections being all over the place, I thought the geometry (sphere, cylinder) was buggered but it's something in the shader as it won't do that with the standard lightweight shader. It's not something like setting default blue as 127 or 128 out of 255/256?
     
  2. hexdump

    hexdump

    Joined:
    Dec 29, 2008
    Posts:
    439
    I'm having problems dragging custom properties to the graph. I can create them in the billboard panel but when I try to drag them into the graph a "forbidden" icon is shown. Is anyone having this issue too?
     
    Last edited: Jun 5, 2018
  3. Paddington_Bear

    Paddington_Bear

    Joined:
    Dec 9, 2012
    Posts:
    274
    I've posted a seperate thread about this but this actually seems like a better place to ask: Has anyone been successful referencing LODcrossfade into ShaderGraph? If so, how did it turn out?
    Cheers
     
  4. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    483
    On a more positive note, I've been using the graph editor to debug the levels of some things. In this case, it's the range of an EXR flipbook.

    You change the min and max values around until the entire image is green. Anything under the min level float is blue, anything above is red. What's left in between shows as green.
    EXR_Debug.png
     
    izym likes this.
  5. Regretful123

    Regretful123

    Joined:
    Nov 5, 2014
    Posts:
    3
    Just tried 2018.2b,
    Shader Graph is still broken beyond belief. Read through comments on this thread and was mention several times that there's a new version. Why is it that the package manager showing us the old version???

    I tried creating LightWeightProcessRendering settings in the project settings and assign it to the Graphics setting of Unity, it made the whole scene turn pink (terrain, default shaders, other custom shader, and the shader graph shader itself still shows pink). (That is unless I remove the settings out of the graphical settings, leaving it to default rendering pipeline).

    I got to a point where one of the Unity representative mentions about editing the Package.Manifest file - made the project unstable and no longer run/launch.

    I'm furious that I cannot try out the Shader Graph right out of the box, let alone do some hack and work around to get it to work right.
     
    GameDevCouple_I likes this.
  6. Alec-Chalmers

    Alec-Chalmers

    Joined:
    Jul 8, 2012
    Posts:
    16
    Thought it was just me
     
  7. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122
    ..... There's a reason why it's called a beta.... And try shaderforge if you want a polished graph asset.
     
  8. Alec-Chalmers

    Alec-Chalmers

    Joined:
    Jul 8, 2012
    Posts:
    16
    Shaderforge is discontinued and doesn't build to Switch (or much else in my experience)
    Polished my arse.
     
    twobob likes this.
  9. SMGX

    SMGX

    Joined:
    Jul 4, 2015
    Posts:
    7
    Is it possible to get outline or shader based edge detection with shader graph? Thanks
     
    hwaet likes this.
  10. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    483
    Shaderforge was only at its peak in the 5.X versions, and was generally acceptable in the 2017 releases in that it wouldn't break or error out in most cases. Amplify is the modern one, you should check that asset to see if it's Switch capable.

    Your other option is to take the shader from shader forge and write it by hand. Assuming you're done developing the shader, it's not too bad an option. In fact, the syntax and examples of very operation you need to use is in the compiled shader force shader!

    Having said that, for both Alec and Regretful, you're talking about an experimental feature on a beta build of Unity. I'm here posting about issues with it, I know. If you're that desperate to use the graph the least you could do is stick to a stable full release of Unity like 2018.1.x, and use the version of LWRP and SG on that. But if you were thinking of using either of these for a product that would ship in the next few months you're mad.

    Currently not, outlines are done in a second pass (not available) with a vertex offset (not available), frontface culling to get it to render inside out (not available, only double-sided for now), and edge detection is as a post-process shader (no examples available, not sure how this would work and what would be exposed to the shader graph).
     
    SMGX likes this.
  11. Paddington_Bear

    Paddington_Bear

    Joined:
    Dec 9, 2012
    Posts:
    274
    Oh dear oh dear. I didn't realised how limited SG is currently. I knew vertex info was out of the question but not the rest.. Explains why nobody has managed to come up with anything really interesting yet - its mostly just glow/dissolve and animated basic shading..
     
    SMGX likes this.
  12. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    483
    Vertex offset seems to be on the close horizon, not sure about multipasses, and the post fx stuff is like a dam, you just need one guy to crack it and the flood appears.

    As for nothing interesting, I wouldn't say that. A nice big demo should be coming out soon using the shader graph almost exclusively. There's been quite a fair few nice things about it too; the subgraphs are a godsend, and while it's lacking portals (for now...?) and the workflow is generally pretty good.
     
    Paddington_Bear likes this.
  13. pakfront

    pakfront

    Joined:
    Oct 6, 2010
    Posts:
    551
    I am trying to implement a simple height based fog, or frankly any fog, in the LWRP for single pass stereo. Since the SPS pipeline doesn't support Post Processing (v2 anyway) I think I need to do it in the surface shader. So, I need to apply the fog after the PBRMaster has calculated the surface color.

    Can I modify the final color returned by the frag shader of PBR master? If not, can I somehow have a non-master PBR node that outputs color/alpha that I can then modify before passing to an Unlit master?

    If not, is there some other way to do custom fog in LWRP?

    /edit - can I override the fog functions in com.unity.render-pipelines.lightweight/LWRP/ShaderLibrary/Core.hlsl ?If so, how?
     
    Last edited: Jun 7, 2018
  14. FenBoy

    FenBoy

    Joined:
    Feb 5, 2015
    Posts:
    2
    Hi, I am trying to develop an efficient system to show point clouds. I am currently using a mesh, where each vertex is a point in the cloud. I'd like to display a circle, or triangle at each point. Once I've done this, i'd like to display multiple point clouds simultaneously and indicate visually using colour where two points from different clouds occupy the same space. i.e. draw them in a brighter colour. I have re-used a couple of 'scripted' shaders that produce point clouds or do stencilling, but I haven't been able to combine them. Is this a problem that can be solved using the shader graph? Thanks
     
  15. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    4,253
    I looked at Shader Graph shortly after it became available as a preview, but found it very limited at that time. Is it possible to process vertices by now, e.g. to make tree leaves wave in the wind?
     
  16. RumataM

    RumataM

    Joined:
    Nov 6, 2016
    Posts:
    15
    Is there a way to use shaders made in Shader Graph in older versions of Unity?
    Can I recompile those shaders somehow into code of standard shaders, or is there any other way?
    Thank you!
     
  17. Paddington_Bear

    Paddington_Bear

    Joined:
    Dec 9, 2012
    Posts:
    274
    I very seriously doubt that. Shadergraph is a visual node based coding tool, in my experience the output is not at all able to be compiled in another standardised format.

    In any case, getting the two methods to work together is bound to be more work than just doing it by hand. For the most part Shadergraph is tackling very uncomplicated techniques at this point in time. In the future I have no doubt it'll be a valuable and powerful tool (much like Unreals solution) but for now.. its a preview of a preview.
     
  18. indieDoroid

    indieDoroid

    Joined:
    Jan 25, 2016
    Posts:
    226
    I'm really crossing my fingers that Unity team will add the functionality later, to be able to have "shader graph" shaders "co-exist" with custom shaders in the same project.

    Updating and adjusting my "custom-shadered" game objects to use "shader graph" shaders would be a nightmare.

    Unfortunately at the moment, using "shader graph" shaders alongside with my cusom shaders, produces pink "shader graph" game objects :oops::(
     
  19. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    805
    Shader graph and custom shaders are possible. But both must be for scriptable render pipelines, not the old shaders.
     
  20. EmilioDLC

    EmilioDLC

    Joined:
    May 12, 2014
    Posts:
    2
    Hi I am trying to incorporate shader graph as well as a post-processing profile in the same project. I can get both to work independently, but the post-processing profile loses all of its rendering effects when I implement the lightweight pipeline asset into graphics settings. I notice MythrilMan51 got bloom working but he has a different version/workflow of post processing. I can't even find a couple of the files post process layer and post process volume in my post processing folders.
     
  21. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122
    You using version 1 or 2?
     
  22. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122
    ALSO! For some heads up... If you use HDR....
    upload_2018-6-10_15-57-33.png
    Watch it if you're using Multiply for your shaders...
    upload_2018-6-10_15-58-43.png
    As THIS
    upload_2018-6-10_15-59-2.png
    Happens...
     
    Paddington_Bear likes this.
  23. Loquinette

    Loquinette

    Joined:
    Feb 13, 2014
    Posts:
    12
    Hey,

    I have a question about shaders for mobile. What would be the most optimized way to do that sort of shaders ? I only see PBR graph when I create a new shader but this one has inputs we may not need (occlusion, metal, smoothness etc).
    I saw there is a "Standard (Simple lighting)" material in the lightweight pipeline materials so I guess there is a way of making a simpler shader (stripped of all these physically based nodes) but I don't know how.
     
  24. EmilioDLC

    EmilioDLC

    Joined:
    May 12, 2014
    Posts:
    2
  25. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    483
    You wouldn't change fog in the shader graph editor. It'll be a render pipeline thing, ave a goof dig through that until you find the part that calculates fog, and modify it there.

    Particle system, set its shape to the mesh, and use spawn on vertex. Use 2 materials, one for each object, both particle/additive, one red one green, where they overlap (not the same position, but at least in front of each other) it'll show yellow.

    I can only assume this is because HDR is rendering as 0-4 or something instead of the usual 0-1 in terms of max brightness. So multiply with what you think is 1 is actually multiplying the brightness by 4? I can't remember this being a problem with SF or any other HDR in Unity (at least for a while) so it's definitely a bug.

    Currently there's only PBR and Unlit, what you're looking for would be a whole new output node. No idea if this is even on the horizon. In the meantime, have you tried testing with shaders made in the PBR graph? While you're doing that, check the lightweight render pipeline asset, see if you can lower pixel light count and some other things to make it run faster, and test that. You might be able to get away with the LWRP's basic PBR setup after all.
     
  26. izym

    izym

    Unity Technologies

    Joined:
    Jul 27, 2013
    Posts:
    24
    Soon in 2018.2 :)

    Ahhh like that. I think that goes into the land of custom lighting. We'll get there eventually, but we have some foundational improvements to make, as well as supporting the full feature set of HDRP.

    Thanks!

    Here is fine :) We will be implementing grouping functionality soon.

    Hmm, that sounds like a bug. Can you make a bug report through "Help -> Report a Bug"? :)

    Unfortunate not yet. This is more or less in the same realm as custom lighting, although it might make sense to go for a more limited variant first where we just give access to the outgoing radiance rather than actual custom lighting evaluation. (This is just me thinking out loud though.)

    Ah yes, we're not generating a meta pass for the GI yet. It's very high on our list though. That's why it's not lighting up other surfaces. As to why it's not getting a glow around itself, MythrilMan51 is on point; bloom will do the trick.

    Are you using HD or Lightweight Render Pipeline? Anyway, your first approach should work once we get the next release published, as it allows you to manually set the reference name for a texture property. As for your second approach, my guess would be that it's because _CameraDepthTexture isn't defined anywhere. That's unfortunately not something we support in the CodeFunctionNode.
     
  27. rominv13

    rominv13

    Joined:
    Dec 7, 2016
    Posts:
    4
    My initial shader graph was showing pink so i had to add scriptable rendering pipeline in the graphic settings now the shader graph is showing proper material but rest of the objects in my project got pink material .is there any way to handle this?
     
  28. izym

    izym

    Unity Technologies

    Joined:
    Jul 27, 2013
    Posts:
    24
    Which version of Unity are you using? If 2018.2, then this has been fixed but not released yet. As a workaround, you can add it to the graph via the "Create Node" menu.

    The new version is not out yet. The source is available on GitHub and can be used similarly to a package. But as it is our development repository, it is not released nor QA'd, and we cannot guarantee that it is stable. If the current package is not working for you, we're happy to help you if you make a bug report through "Help->Report a Bug". Are there any errors in the console?

    Vertex position support is right around the corner.

    Unfortunately this is not supported. It's likely that we'll add in support for this in the future, but for now the Master Nodes are very generic, and have to work across both HD and LW. E.g. reading the output color would not be possible in a deferred rendering setup. We're working on a solution that allows you to make choices about things like this. In this case, reading the output color would force you into forward mode in HDRP.

    Available on GitHub now, going into a package very soon :)

    Unfortunately that's not possible.

    Unfortunately we don't have a simple lighting workflow for Shader Graph yet :/ We will definitely have that in the future.

    You can use the material upgrader in "Edit -> Render Pipeline". Make sure to make a backup of your project, as the upgraders are one-way and not undoable.
     
    Paddington_Bear and Peter77 like this.
  29. izym

    izym

    Unity Technologies

    Joined:
    Jul 27, 2013
    Posts:
    24
  30. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,920
    @izym Thank you and the team, been waiting for this one a while :)
     
    Paddington_Bear likes this.
  31. scheidtventureestate

    scheidtventureestate

    Joined:
    Nov 28, 2017
    Posts:
    33
    Just updated. Works well! I only had to re-save generated graphs and here and there a texture reference was lost from an exposed shader property in the material (probably because we can edit references now). Awesome.
     
  32. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,920
    With HDRP getting console spamming which is slowing down my modest dev box a bit:

    Property (_Env2DCaptureVP) exceeds maximum allowed array size (1024). Cap to (1023).
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    Any resolution?
     
  33. scheidtventureestate

    scheidtventureestate

    Joined:
    Nov 28, 2017
    Posts:
    33
    Mh, with v2, the MeshRenderer Graphs of the example Unity Shader Library are listed under "failed to Compile" and show pink in the shader graph. I do not use them; but worth a note.
     
  34. asa989

    asa989

    Joined:
    Dec 18, 2015
    Posts:
    31
    Unity, can u please add RWBuffers as well :)
     
  35. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122
    I guess that's the case... I was trying to blend some colors together for shadows. ALSO... Newsflash... I couldn't download Unity 2018.1.4.... Library says it's missing.... Any word on that?
     
    Last edited: Jun 11, 2018
  36. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122
    upload_2018-6-11_14-7-45.png As seen here.
     
  37. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122
  38. CatInTree

    CatInTree

    Joined:
    Jun 11, 2018
    Posts:
    5
    Whenever I attempt to use the Lightweight Render Pipeline template for shader graphs, the package is imported incorrectly, which causes around 10 compiler errors.

    Shader error in 'GPUCopy.compute': failed to open source file: '../ShaderLibrary/Common.hlsl' at kernel KSampleCopy4_1_x at GPUCopy.compute(3) (on d3d11)


    Shader error in 'EncodeBC6H.compute': failed to open source file: 'CoreRP/ShaderLibrary/Common.hlsl' at kernel KEncodeFastCubemapMip at EncodeBC6H.compute(1) (on d3d11)


    Shader error in 'LightweightPipeline/Terrain/Standard Terrain': failed to open source file: 'LWRP/ShaderLibrary/Terrain/InputSurfaceTerrain.hlsl' at line 63 (on d3d11)


    Shader error in 'LightweightPipeline/Terrain/Standard Terrain': failed to open source file: 'LWRP/ShaderLibrary/InputSurfacePBR.hlsl' at line 84 (on d3d11)


    Shader error in 'LightweightPipeline/Standard (Simple Lighting)': failed to open source file: 'LWRP/ShaderLibrary/InputSurfaceSimple.hlsl' at line 102 (on d3d11)


    Shader error in 'LightweightPipeline/Standard (Simple Lighting)': failed to open source file: 'LWRP/ShaderLibrary/InputSurfaceSimple.hlsl' at line 133 (on d3d11)


    Assembly has reference to non-existent assembly 'Unity.ShaderGraph.Editor' (Packages/com.unity.render-pipelines.lightweight/LWRP/Editor/com.unity.render-pipelines.lightweight.Editor.asmdef)


    Shader error in 'LightweightPipeline/Standard (Physically Based)': failed to open source file: 'LWRP/ShaderLibrary/InputSurfacePBR.hlsl' at line 148 (on d3d11)


    This makes the Lightweight RP unusable, in my case.

    What causes this and how do I fix it?
     
  39. Kink3d

    Kink3d

    Unity Technologies

    Joined:
    Nov 16, 2015
    Posts:
    45
    This should now be possible (with a slight workaround) in the latest version available for 2018.2 beta. You can get 2.0.1 from the package manager.

    While we are still working on a render pipeline agnostic method to the problem, for LWRP at least you can now make a texture property and set its reference name to "_CameraDepthTexture". Make sure to uncheck "Exposed" or it wont work.

    This however is still a workaround, and youll need to do some additional work to replicate the Linear01Depth function when sampling.
     
  40. ssartell

    ssartell

    Joined:
    May 21, 2018
    Posts:
    14
    I'm not sure if I'm doing something wrong, but anytime I try to add a sub graph to my project, I can no longer create nodes in my main shaders. When I right click and click "create node" or drag an output/input, nothing happens. The normal window to select the new node just doesn't show up. I was hoping v2.0.1 would solve it, but it's still happening. Is this a known issue?

    Edit: It looks like sub graphs cause problems for me in general, but I think this particular issue happens when I add a boolean input. If I create a brand new sub graph with a single boolean property and nothing else, I can no longer create nodes in my PBR shaders.
     
    Last edited: Jun 12, 2018
  41. deadlyshadoff

    deadlyshadoff

    Joined:
    Jan 23, 2016
    Posts:
    13
    Alpha Cutout doesn’t apply to shadow (previously it fixed by adding addshadow to pragma)
    Now I see only square shape shadows.
     
  42. FreezedIce

    FreezedIce

    Joined:
    Jun 12, 2018
    Posts:
    2

    Attached Files:

  43. scheidtventureestate

    scheidtventureestate

    Joined:
    Nov 28, 2017
    Posts:
    33
    Last edited: Jun 12, 2018
  44. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    876
    Will shader graph be supported in HDRP in 2018.2 ?.
     
  45. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    konsic likes this.
  46. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    876
  47. Uteki

    Uteki

    Joined:
    Apr 17, 2017
    Posts:
    5
    Is there here a way to cast Texture2D to Texture3D using only shader graph?
     
  48. davidcox70

    davidcox70

    Joined:
    Oct 19, 2016
    Posts:
    19
    I am being stupid? I can't get a normal map to apply properly if I use the shader graph. Below, both default spheres have the same normal map applied. The one on the left is done by a Lightweight standard PBR shader and is shown correctly. The one on the right is done using the shader graph layout shown below the spheres. I have also tried various combinations of unpacking normals, application of UVs etc. Am I missing something?

    shader graph normals.jpg
     
  49. rvilgalys

    rvilgalys

    Joined:
    May 10, 2016
    Posts:
    3
    Hello,

    I upgraded to the latest 2.0.1 preview for the Lightweight Pipeline & Shadergraph packages. I'm now getting the following warning when I edit a shader:

    'Metal: Fragment shader missing buffer binding at index 3 (_LightIndexBuffer / PBR Master)'

    This will repeat 4 times, and there is no preview of the shader results in the Shadergraph editor. Downgrading everything back to the last version works fine again.
     
  50. StarWafle

    StarWafle

    Joined:
    Jun 12, 2018
    Posts:
    3
    Nice and shine! But, is it any ETA on tessellation?
     
Thread Status:
Not open for further replies.