Search Unity

Are URP/Unlit Shader Graphs incompatible with Hybrid Renderer?

Discussion in 'Graphics for ECS' started by DK_A5B, Apr 13, 2021.

  1. DK_A5B

    DK_A5B

    Joined:
    Jan 21, 2016
    Posts:
    110
    Are URP/Unlit shader graphs incompatible with Hybrid Renderer when using URP 10.4 and Hybrid Renderer 0.11.0-preview.42? I've created an extremely simple Unlit Shader Graph for URP:

    error.png

    And when the Entity conversion happens, I'm getting an error message stating that it is either:
    1. Not compatible with Hybrid Renderer v2
    2. Missing DOTS_INSTANCING_ON
    3. A problem with DOTS_INSTANCING_ON variant.

    You can see from the screenshot (yellow) that the graph is compatible with the SRP batcher (which I know causes problems if it isn't). I've checked the keywords, and DOTS_INSTANCING_ON is present. So the only thing I can think of is that there is an issue where the Hybrid Renderer doesn't support Unlit shader graphs for URP, is that the case?

    Previously I had been working with Unity 2021.2.0a10, URP 12, and Hybrid Renderer 0.11.0-preview.42 and Unlit URP shader graphs work just fine with that. However, I'm in the process of downgrading to 2020 LTS because of Unity's announcement about support for ECS, and since the downgrade all of my Unlit shaders are choking on this error.

    I tried creating a simple project to isolate the issue (that's the one from the screenshot above) and it does seem to be an issue with Hybrid Renderer and the Unity/URP version. Once I upgrade this project to 2021.2 and URP 12 the issue is resolved.
     
  2. Fribur

    Fribur

    Joined:
    Jan 5, 2019
    Posts:
    136
    See also hybrid renderer pinned thread, last 2 pages, there is also a linked and QA reproduced bug report. I am guessing such sympoms are exactly why we saw this announcement about DOTS being stuck with 2020.3 LTS. I have the same issue popping up upgrading from 2021.1.0 to 2021.1.1. I can resolve it going back to 2021.1.0, but strangely going back to 2020.3 LTS now gives me same error as well :-(
     
  3. Unity in general doesn't support downgrading. Although given the circumstances they may give a special consideration this time since they are forcing us to go back to a previous LTS.

    With that said, you would be better off, I think, if you just copy the previous versions (the 2020.3 ones) of your shaders from version control and apply changes if needed after you overwrite the ones currently are in your project (after backup and version control, obviously). At least I would do this way if possible.
     
  4. DK_A5B

    DK_A5B

    Joined:
    Jan 21, 2016
    Posts:
    110
    I'm not sure I follow what you mean. I have a project that was created on the 2021.2 alpha path, and now - based on yesterday's announcement - I realize that I need to move to 2020 LTS. That's a version downgrade, which I'm trying to work through now. Unity definitely doesn't support that, which is what is making it a challenge.

    My repositories don't have 2020.3 versions of the Shader Graph shaders, they're 2021.2 versions (because that's what they were created in).

    The screenshots above aren't from my actual project, they are from a dummy project I created to try and debug the issues that I'm seeing as I convert my project from 2021.2 to 2020.3. The issue I'm seeing in this dummy project has nothing to do with conversion, since it's a brand new project I created using Unity 2020.3. The problem is that 2020.3 LTS + URP 10.4 + Hybrid Render 0.11 (which is the most up to date version of everything on the now recommended ECS path) appears to not support Unlit Shader Graph shaders.
     
  5. My bad, I've got the impression it is a long term project and you came up to 2021.2 from 2020. Maybe I mixed up with someone else's problem or some other statement of yours. Sorry about that. Please disregard my comment then.
     
  6. DK_A5B

    DK_A5B

    Joined:
    Jan 21, 2016
    Posts:
    110
    No problem. The project itself probably did start back on 2020.x, but the relevant Shader Graph work has all been post the upgrade to 2021.x. I appreciate the effort to help.
     
  7. DK_A5B

    DK_A5B

    Joined:
    Jan 21, 2016
    Posts:
    110
    Thanks for the background info.

    For what it's worth, for anyone else having this issue, I've had some luck by exporting the Shader Graph shaders as code from the 2021.2 version of my project and then pasting that as an Unlit shader into the 2020.3 version of my project. This might work as a work around for anyone else dealing with this issue as long as they either (a) don't need to make any changes to their shader or (b) are comfortable writing/modifying shaders in HLSL.

    The fact that this does work also tells me that the problem is with the code generator for Shader Graph in URP 10.4. I'm trying to analyze the diff between the code generated for my graphs in URP 10.4 (Unity 2020.3) and URP 12.0 (Unity 2021.2) to see if I can pin down the exact issue. I'll post back here if I come back with any meaningful results so that anyone else dealing with this make use of that information.
     
  8. Fribur

    Fribur

    Joined:
    Jan 5, 2019
    Posts:
    136
    My fix to get it my unlit URP Shadergraphs working again on 2020.3.3f1 was to downgrade Universal RP and ShaderGraph from 10.4.0 to 10.3.2. Which used to be easy via Package Manager; did it now via editing manifest.json:
    Code (CSharp):
    1.     "com.unity.render-pipelines.universal": "10.3.2",
    Snap..all error spamming gone, back to normal.