Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Shader Graph default rendering pipeline support

Discussion in 'Shaders' started by Alec-Chalmers, Jun 6, 2018.

  1. Alec-Chalmers

    Alec-Chalmers

    Joined:
    Jul 8, 2012
    Posts:
    16
    We're upgrading to 2018, and I'm trying to find info on whether or not the new shader graph supports the default rendering pipeline (not the lightweight or HD pipelines).

    We're using Unity 2018.1.2f1 pro.
     
    IgorAherne and afshin_a_1 like this.
  2. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    823
    I don't think it does. Seems like it only supports scriptable renderpipelines.
    From https://github.com/Unity-Technologies/ShaderGraph/wiki/Getting-Started
    I wish they would make a srp for the default renderpipeline prior to 2018, so that all old shaders could be integrated easily.
     
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    Nope, and they never plan to. I seem to remember they made some comments about how Shader Graph is designed to be extensible so it could support custom SRPs, and potentially someone in the community could extend the Shader Graph to support the current default forward and deferred pipelines, but it's not something they're going to do nor intended to make possible. I can't find the post(s) where they talk about it, but I think it was buried somewhere in the Shader Graph feedback thread, or otherwise on the experimental graphics features forums.

    Those two things, making an SRP the default, and old shaders being easy to integrate, are unrelated things.

    Both of the existing SRPs drastically change how shaders are setup for lighting so there's no "easy" way to integrate them (especially since they've abandoned Surface Shaders). Also neither the LW nor the HD SRPs are production ready. My impression is they had originally intended to keep the default forward and deferred rendering paths for a while, and eventually make the HD SRP the default sometime in the future. However the HD SRP is taking longer than they expected so they've pivoted to bring the LW SRP up to parity with the existing forward rendering path with what looks like a plan to make that the default sometime next year. They've not said this explicitly, it is just my impression from the other comments they've made. Even if I'm correct and that's their internal plan, it could always change.
     
    grubertm_unity likes this.
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I recommend Amplify shader editor for all your built-in graph needs.
     
    hertz-rat and protopop like this.
  5. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,557
    So is shadergraph and amplify shader editor both used to create custom shaders visually? They’re essentially the same thing?
     
  6. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I recommend unity's shadergraph for SRP.

    Above post was from 2018, when Unity's graph was sketchy at best. Generally both will achieve the same stuff, yes.
     
  7. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,557
    Thank you.

    I use the built in render because I want deferred, but I make mobile games. I was checking out shadergraph but saw the incompatibility. If amplify shaders does a similar thing but for built in too I will give it a try:)
     
    ksam2 and afshin_a_1 like this.
  8. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Amplify is what I used before moving to SRP, I did some beautiful stuff with it. I believe it will continue to work for SRP as well but if moving to SRP I think in the long term it will be best to use Unity's even so because it will always have that first party support going forward.

    As built-in pipeline isn't going to change any more, I think amplify will continue to work fine for that, just not necessarily be up to date for HDRP, specifically, and especially not before HDRP is released.
     
  9. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,557
    I’d love to use unity’s shadergraph, but it just won’t work with what I use now, the built in pipeline, so unfortunately it’s not an option.

    Neither is switching to Srp: they are not officially supported for a Long time, many assets don’t work with them, and there’s no deferred mobile option.

    I wish I could take more advantage of many unity features - shadergraph, timeline, etc but when you have legacy projects, upgrading to newer versions of unity can be very difficult. I think it’s my biggest challenge with game design: keeping up with the backwards breaking changes.

    anyways thanks for the good advice. As usual you seem to have very solid understanding of unity’s various options
     
  10. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    Built-in/default renderer support for shadergraph is being added in the future. It will be added as a graph target just like URP/HDRP. Didn't think this would actually happen but they are doing it, great news I think :)
     
    Mehrdad995 likes this.
  11. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It's not that weird a move to be honest. It will allow people to migrate from built-in a bit easier if all their shaders are compatible in some form.
     
    alexanderameye likes this.
  12. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    736
    Just thought I would chime in on this. From the looks of Shader graph support for the unity default graphics pipeline is being added. I do not know when it will be added however but there is a PR that says as much. https://github.com/Unity-Technologies/Graphics/pull/4283
     
  13. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    Yup that was the PR I was referring to. Great news :)
     
    HeadClot88 likes this.
  14. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    658
    Does anyone know if this made it to release?
     
  15. ThynkTekStudio

    ThynkTekStudio

    Joined:
    Sep 4, 2021
    Posts:
    59
    apparently no
     
  16. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,557
    Since my post a few years ago above I've been using amplify shader editor. I find it easy to use and it can export to all render pipelines. It's a paid asset, but it's half off for the New Years sale.
     
    stonstad likes this.
  17. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    It made it into the latest release, Shader Graph 13.0, for Unity 2022.
     
    TerraUnity, stonstad and protopop like this.
  18. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    1,247
    Great news! Quick question: Is the created shader interchangeable between all pipelines of HDRP, URP & Standard in a universal manner?
     
  19. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    It would appear so*.

    With the big caveat that it doesn't appear that you can't add the HDRP / URP pipeline to your shader graph unless the shader is already in that pipeline and having the HDRP added to a shader causes warnings and unusable values to appear in the graph settings and master stack when used in the URP and BIRP as the HDRP shader at this point is significantly different enough to not actually be compatible with the other pipelines.

    But the base color, normal, metallic, smoothness, and emission will all get reused in all 3 pipelines.
     
    TerraUnity likes this.
  20. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    1,247
    Having shared base color, normal, metallic, smoothness, and emission is not even enough to try it out :)
     
  21. Tudor

    Tudor

    Joined:
    Sep 27, 2012
    Posts:
    150
    Hi Bgolus, just trying to understand what's the best / possible / intended way to make a custom Scriptable Render Pipeline that is recognized by Shader Graph.

    Because I followed the custom RP unity tutorial, where it says:

    "Optional: com.unity.render-pipelines.shadergraph. Install this package if you intend to use Shader Graph or modify the Shader Graph source code as part of your custom SRP."

    But that's confusing/misleading/wrong?, because ShaderGraph does not recognize / cannot use the resulting scripting render pipeline. (So what does that statement intend to say??)

    Should I instead just say screw it and edit e.g. the Universal Render Pipeline unity package, instead of creating my own custom scriptable renderpipeline?

    (My intention is to have more control than just ScriptableRendererFeatures and/or Custom Function Nodes)
     
  22. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    If you use a custom SRP, you also need to use a custom Shader Graph. Shader Graph's base package just handles generating HLSL from the various nodes, but doesn't provide a master stack or how the generated HLSL is used, that's all on you.

    How that works? No idea. You can maybe pick apart the code here to see if you can figure it out on your own. I don't really do anything with the SRPs so my knowledge here is limited.
    https://github.com/Unity-Technologi...render-pipelines.universal/Editor/ShaderGraph
     
    Tudor likes this.
  23. doodaddy

    doodaddy

    Joined:
    May 2, 2015
    Posts:
    10
    Glad I found this discussion!

    I'm experimenting with 2022.1.23f1, and the option for Shader Graph is 13.1.8, which claims "Currently, both the High Definition Rendering Pipeline and the Universal Rendering Pipeline support Shader Graph." It doesn't mean BIRP.

    Should I try it anyway (by clicking "install")?

    P.S. If I start a URP project with this version of Unity, the Shader Graph is present as I believe it was a dependency.