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

Question Shader Graph in 2019 (and older) vs 2020 (and newer)

Discussion in 'Shader Graph' started by Steven-1, Mar 16, 2022.

  1. Steven-1

    Steven-1

    Joined:
    Sep 11, 2010
    Posts:
    455
    I'm very new to Shader Graph.
    I made some shaders in Shader Graph in a Unity 2020.2 project, but now it seems I can't import them in a 2019.4 project.
    And when trying to make a ShaderGraph shader in 2019 seems to not be possible, it seems like they are called sub shaders instead? and they are somewhat different?

    Can anyone explain this to me? Did shader graphs completely change how they work inbetween 2019 and 2020? Are they compatible? Is there a way to have ShaderGraph shaders work in all version of Unity (in URP)?

    I can't seem to find anything about this
     
  2. Steven-1

    Steven-1

    Joined:
    Sep 11, 2010
    Posts:
    455
    anyone?
     
  3. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,296
    Well, it's normal that software is not backwards compatible, but if you made graph in 2019 and imported to 2020 then it should be able to upgrade it. However I am not sure what you mean about subshader, it's completely something else, maybe you meant subgraph? And no, in all versions graph is graph and subgraph is subgraph.
     
  4. Steven-1

    Steven-1

    Joined:
    Sep 11, 2010
    Posts:
    455
    we're talking about a shader, not an entire application, I do expect a shader made in Unity 2020 to work in Unity 2019.
    At least, in all Unity versions that support shader graph.

    I don't know about the all differences between all the different RP stuff, I just know there isn't the same option in the 2019 version to make a shader graph shader as in 2020. All I could find in 2019 was something called subshader or subgraph (not sure anymore, and can't check right now), and that at least resembled the shadergraph stuff in Unity 2020
     
  5. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,296
    I didn't dig in the code, but I don't think you can expect that. Shader is generated from graph, so if graph is not valid then it's not possible to generate shader. Additionaly shader is generated from some library and it also changes from version to version. However, if you copied generated code, then I guess it could be compatible, but again it might not be true, for example 2021(?) introduced light layers and code generated in that version might not work in 2020, but I have no clue if that would happen.

    Subshader is shaderlab thingy and it has nothing to do with shader graph. I don't remember now, but in my memory there always was option to create shader graph lit/unlit. Are you sure shader graph package is installed?