Search Unity

Question Getting Error when customizing Shader Graph

Discussion in 'Graphics for ECS' started by seasidehut0216, Apr 27, 2022.

  1. seasidehut0216

    seasidehut0216

    Joined:
    Apr 27, 2022
    Posts:
    2
    Me and my team is working on our project and constantly getting Error when customizing the shader graph:

    A Hybrid Renderer V2 batch is using the shader "Shader Graphs/TestLight", 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&)

    version patches are:
    Unity 2020.3.33f1c2
    URP 10.8.1
    Hybrid Renderer 0.50.0-preview 24

    and here's the screenshots: 微信图片_20220427171721.png 微信图片_20220427171748.png 微信图片_20220427171836.png

    please help~!
     
    Last edited: Apr 27, 2022
  2. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    Based on the screenshot that Shader Graph should work with the Hybrid Renderer. It is possible you have encountered a bug.

    I would recommend checking the "View Generated Code" for the Shader Graph and see if there's anything odd there.
     
  3. seasidehut0216

    seasidehut0216

    Joined:
    Apr 27, 2022
    Posts:
    2
    Hi sir,

    Thanks a lot for your reply. We've checked the View Generated Code for the Shader Graph and here's the screenshot.
    upload_2022-4-28_14-45-8.png

    The other thing is that we were browsing through the forum and were trying to get the answer for the issue, and we found a reply from you, even though it was from last year we still gave it a try.

    You've mentioned in that reply that the breakage of the shader graph might caused by incorrect ordering of subshaders. So me and my co-devs tried to modify our shader target 2.0 to 4.5 ones. however that didn't work out, can you give us some advice on how to generate code for target 4.5 shader please?
     
  4. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    The screenshot you posted seems to correctly define a target 4.5 shader (see "#pragma target 4.5"), and it has the correct DOTS_INSTANCING_ON multi_compile as well. There shouldn't be anything else required, other than to define at least one DOTS instanced property, but shader graphs should always reference the transform matrix so that should be taken care of.

    The next thing I would try is to look at the UNITY_DOTS_INSTANCING macros for definining the shader properties (in this case, Color), just to rule out something weird there.

    Does the shader completely fail to render, or are you just getting a single error message with otherwise correct operation? We have seen the latter (single spurious error) happen when Unity is still compiling the shader and incorrectly issues the error for the placeholder "Loading" shader, and the actual shader is fine once it has compiled.

    If the shader is failing to render, would it be possible for you to submit a bug report with a small repro project?