Search Unity

Bug Shader is either not compatible with Hybrid Renderer V2, is missing the DOTS_INSTANCING_ON

Discussion in 'Graphics for ECS' started by Jyskal, Aug 12, 2021.

  1. Jyskal

    Jyskal

    Joined:
    Dec 4, 2014
    Posts:
    28
    Hello,

    I have an issue with all my shaders and Hybrid RendererV2. I always get the following error:
    The shaders are the standard unity shaders that are generated using Assets > Create > Shader > URP > Sprite Lit/Unlit Shader Graph. But all of the shaders seem to suffer from the error above. Also the project is a fresh project.

    After some googling around I found that this issue has been around in URP 10.4 for a while. According to this link, a fix was introduced in URP 10.6.0.

    https://issuetracker.unity3d.com/is...t-shadergraph-is-broken-in-hybrid-renderer-v2

    However upgrading to URP 10.6 or downgrading to URP 10.3.2 (as suggested in the link) did not change anything.

    Does anyone else have a workaround for this issue or have a working shader?

    Unity 2020.3.15f2
    Hybrid Renderer 0.11.0-p44
    URP 10.5.1
    Shader Graph 10.5.0
     
  2. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    After upgrading to URP 10.6, you can try if reimporting the Shader Graphs helps. Reimporting should cause a full codegen -> recompile. Otherwise there's a chance you might still be using the graph that was generated with the older URP version.
     
  3. Jyskal

    Jyskal

    Joined:
    Dec 4, 2014
    Posts:
    28
    Upgraded to URP 10.6 + reimported shaders but the issue remains.
    However I noticed that on URP 10.5.1 and URP 10.6.0 the issue is limited to the Unlit/Lit Sprite Shader. The Unlit/Lit Shader (not Sprite) does seem to work.

    Also tried to create a new Unlit/Lit Sprite Shader but that also results in the same error message.

    Possibly there is something wrong the Sprite Shader template?
     
    Last edited: Aug 12, 2021
  4. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    Unfortunately, Sprite shaders are not currently officially supported by Hybrid Renderer.
     
  5. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    Sorry for necro, but I have the same error message in a fresh project with latest packages. I tried different built-in shaders and none of them work (albeit the manual states they are instancing-compatible). So I'm out of ideas and about to give up on DOTS/ECS/HybridRenderer.
     
  6. joelv

    joelv

    Unity Technologies

    Joined:
    Mar 20, 2015
    Posts:
    203
    You need to use SRP shaders, as URP or HDRP is required for hybrid renderer to work in the newer packages (0.50 and up).
    URP/Lit for example. The error might be shown once anyway while the correct shader variant compiles, something that has been fixed for upcoming unity versions.
     
    exiguous likes this.
  7. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    Thanks for your response Joel,
    but there is a misunderstanding and it is entirely my fault. I have started a fresh URP project (from the URP template in Unity Hub). So the shaders are for URP (Universal Render Pipeline / Lit specifically, and I tried some more).
    So with my sentence "I tried different built-in shaders" I did not mean shaders for the built-in render pipeline. But shaders provided by Unity for URP. Sorry for the confusion.
    Anyway. Thats my problem. That Hybrid renderer gives me this error message albeit I use a correct shader. My linked forum thread has additional information. And from this thread here it seems there is a tiny possibility that this is some Unity error/bug. As I said. I'm out of ideas what else to try.

    Here is again the complete error message for reference:
    A Hybrid Renderer V2 batch is using the shader "Universal Render Pipeline/Lit", but the shader is either not compatible with Hybrid Renderer V2, is missing the DOTS_INSTANCING_ON variant, or there is a problem with the DOTS_INSTANCING_ON variant.
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
    So when you say the shader *should* do, maybe the last point applies and there is a problem with the DOTS_INSTANCING_ON variant?
    Also in the material I have verified that the last point, Enable GPU Instancing, is checked.

    So when I can't see my entities this is quite a road block for me. And it's still possible some user error (read: my fault). But I find it incredibly hard to get even a simple sphere prefab rendered in ECS.
     
    joelv likes this.
  8. lurye

    lurye

    Joined:
    Dec 29, 2021
    Posts:
    1
    Elapotp likes this.
  9. Elapotp

    Elapotp

    Joined:
    May 14, 2014
    Posts:
    98
    Will it be fixed for OpenGLES 3?