Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Are HDRP and URP Shadergraph shaders interchangeable?

Discussion in 'High Definition Render Pipeline' started by MadeFromPolygons, Nov 8, 2019.

  1. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,997
    As in if I switch from one pipeline to another (and yes I am aware of the many differences between them and what that would entail), can I still use the same graphs I authored before, or will I have to make them again?

    EDIT: probably worth mentioning I am using only the albedo color slot, which is available on both, so realistically it should work right?
     
    Last edited: Nov 8, 2019
  2. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    Only if you use the PBR Master node. That's the only node in shader graph that's universal and you would also have to make sure you aren't using specific nodes to a pipeline in the graph.
     
    MadeFromPolygons likes this.
  3. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
    I'd be more concerned about the needed inputs etc that might not exist on the other pipeline, especially if you're going from URP to HDRP. I mean those ones that you would access by creating some custom properties.
     
    MadeFromPolygons likes this.
  4. Ehredt

    Ehredt

    Joined:
    Jun 20, 2018
    Posts:
    79
    I just did that today! If you're not using compatible master nodes, you can copy and paste most of your ShaderGraph nodes from one graph to another -- mine was pretty seamless although I had to re-add the properties and update the settings in the master nodes manually. But yeah, shockingly low-maintenance even with incompatible master nodes.
     
    MadeFromPolygons likes this.
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yeah you need to replace the master node but mostly node graphs are just logic that change data before it gets to the master (end) node.

    So just changing the end node usually works. What might be different is any world space stuff. For that, the nodes have a world space and Absolute world space so you can toggle it (HDRP is camera relative).

    Graphs are largely SRP neutral, but the master node is implemented by the used SRP.
     
    MadeFromPolygons likes this.
  6. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    You can just copy the shader file from one project to the other. You wouldn't need to do anything else unless you had some nodes in the graph that doesn't work with the other SRP
     
  7. Ehredt

    Ehredt

    Joined:
    Jun 20, 2018
    Posts:
    79
    This is all good to know and will save me a couple minutes in the future -- thanks!
     
  8. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,997
    Thanks everyone!

    In the end I ended up remaking a lot of the shaders from scratch as I used it as an opportunity to overhaul things, but I can confirm that the majority of the graphs functioned fine in HDRP due to using the correct master node