Search Unity

Question Error message in URP project

Discussion in 'Graphics for ECS' started by exiguous, Aug 6, 2022.

  1. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    I have started a new URP project, imported current Hybrid renderer (Version 0.51.1-preview.21) and followed the Moetsi-tutorial (which is a bit oudated).
    The problem is, I cannot see the spawned entities (they appear in DOTS-hierarchy though and seem to have all relevant components). Instead the console contains this error:
    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&)
    This happens when the prefab is a standard Unity-sphere with default URP-Lit material. I created another material and checked "Enable GPU Instancing". Same error. Now I don't really know what else to do here. Is it so hard for Unity to convert it's own meshes and materials to properly work with their renderers? What am I supposed to do to show a simple sphere prefab in ECS? Any ideas?

    Edit: This is especially confusing because the Unity instancing manual states:
    When I verified that all requirements are met (target 4.5, DOTS_INSTANCING_ON,
    UNITY_DOTS_INSTANCED_PROP) the shader is lacking the last one. And I'm quite unsure where I can add it, what to add and wether I can change built in shaders (or they are overwritten in any update).
     
    Last edited: Aug 7, 2022
  2. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    Which Unity version and which URP version are you using? The URP/Lit shader should definitely be compatible.

    In case you want to make local modifications to URP shaders, copy the URP package folder from Library/PackageCache/ to Packages/. Unity will pick it up from there, and won't overwrite changes you make inside that folder.
     
  3. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    Unity 2021.3.6f1 (Linux Editor) @ Xubuntu 20.4 (I know it's not officially supported, but had no issues).
    URP 12.1.7 (was installed when creating the project via Unity Hub URP 3d template)
    Hybrid Renderer 0.51.1-preview21
    Entities 0.51.1-preview21
    OpenGL 4.5 is shown in Unity window

    Here is another thread with the same issue.

    I'm going to purge (and reinstall) my system in the next 2 or 3 weeks. Maybe it works better with a clean install of everything.

    Thanks for the hint. Do you mean "copy" or "move"? Won't that cause problems when the package exists twice?
     
  4. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    Copying should be fine AFAIK. Unity should prioritize the copy in Packages/ over the temporary copies in the Library/PackageCache/ folder.

    Another thing to check would be if the Unity Editor reports any errors for the URP/Lit shader when you select it in the Editor.
     
  5. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    Thanks for getting back with me Jussi.

    I have tried applying different URP-shaders to the material and the message appears for all of them in play mode (and nothing renders).
    When selected no message appears. However, When compiling the shader variants the process terminated after a while with following errors:
    Shader warning in 'Universal Render Pipeline/Lit': gradient instruction used in a loop with varying iteration, attempting to unroll the loop at /home/MYPATH/Library/PackageCache/com.unity.render-pipelines.universal@12.1.7/ShaderLibrary/LightCookie/LightCookieInput.hlsl(102) (on vulkan)

    Compiling Subshader: 0, Pass: ForwardLit, Vertex program with _CLUSTERED_RENDERING _LIGHT_COOKIES
    Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
    Disabled keywords: DIRLIGHTMAP_COMBINED DOTS_INSTANCING_ON DYNAMICLIGHTMAP_ON FOG_EXP FOG_EXP2 FOG_LINEAR INSTANCING_ON LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING SHADER_API_GLES30 SHADOWS_SHADOWMASK UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHTS_VERTEX _DETAIL_MULX2 _DETAIL_SCALED _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN _NORMALMAP _PARALLAXMAP _RECEIVE_SHADOWS_OFF

    Then 15 of those with varying iteration counts:
    Shader error in 'Universal Render Pipeline/Lit': unable to unroll loop, loop does not appear to terminate in a timely manner (71 iterations) or unrolled loop is too large, use the [unroll(n)] attribute to force an exact higher number at /home/MYPATH/Library/PackageCache/com.unity.render-pipelines.universal@12.1.7/ShaderLibrary/Lighting.hlsl(306) (on vulkan)

    Compiling Subshader: 0, Pass: ForwardLit, Vertex program with _ADDITIONAL_LIGHT_SHADOWS _CLUSTERED_RENDERING _LIGHT_COOKIES _LIGHT_LAYERS _SHADOWS_SOFT
    Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
    Disabled keywords: DIRLIGHTMAP_COMBINED DOTS_INSTANCING_ON DYNAMICLIGHTMAP_ON FOG_EXP FOG_EXP2 FOG_LINEAR INSTANCING_ON LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING SHADER_API_GLES30 SHADOWS_SHADOWMASK UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHTS_VERTEX _DETAIL_MULX2 _DETAIL_SCALED _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN _NORMALMAP _PARALLAXMAP _RECEIVE_SHADOWS_OFF

    Shader error in 'Universal Render Pipeline/Lit': Internal error communicating with the shader compiler process. Please report a bug including this shader and the editor log.

    Shader compiler: Compile Universal Render Pipeline/Lit - ForwardLit, Vertex Program: Internal error communicating with the shader compiler process. Please report a bug including this shader and the editor log.
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    Shader Compiler IPC Exception: Terminating shader compiler process
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    So maybe there is a problem with the urp shader(s) in vulkan?

    Then I added a normal (non-ECS) sphere and it shows fine in playmode.

    So maybe I find some time on the weekend to file the bug report and this issue can be fixed in a future version. Or is this futile as Xubuntu is not officially supported?
     
  6. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369
    Do you using addressables ?
    I have this error for asset loaded & converted from addressable but not for those who were in the scene and tag "Convert to entity"
     
  7. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    No (at least not that I'm aware of). The tutorial I followed just created the sphere prefab from scratch.
    May I ask wether you are on Linux too? Because for me the problem seems related to Vulkan. But whatever it is, the error message is too vague and misleading.
     
  8. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369
    nop, win for me
     
  9. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    This certainly sounds like it could be the case. I have been running URP on Vulkan on Windows and Android, but it's possible that there is a Linux specific problem.

    Also, the error messages you posted are from shader variants that are not using DOTS_INSTANCING_ON (it's in the disabled keywords list). Perhaps the problem could be related to the _CLUSTERED_RENDERING keyword?
     
  10. Brainshack

    Brainshack

    Joined:
    Mar 1, 2013
    Posts:
    33
    Getting the same issues. On Windows 10. Created a new Project in 21 LTS, URP Template. Then added hybrid renderer package and then added a Plane to the Scene:

    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&)

    Manifest.json looks like this:

    Code (JavaScript):
    1. {
    2.   "dependencies": {
    3.     "com.unity.collab-proxy": "1.15.18",
    4.     "com.unity.feature.2d": "1.0.0",
    5.     "com.unity.ide.rider": "3.0.15",
    6.     "com.unity.ide.visualstudio": "2.0.16",
    7.     "com.unity.ide.vscode": "1.2.5",
    8.     "com.unity.render-pipelines.universal": "12.1.7",
    9.     "com.unity.rendering.hybrid": "0.51.1-preview.21",
    10.     "com.unity.test-framework": "1.1.31",
    11.     "com.unity.textmeshpro": "3.0.6",
    12.     "com.unity.timeline": "1.6.4",
    13.     "com.unity.ugui": "1.0.0",
    14.     "com.unity.visualscripting": "1.7.8",
    15.     "com.unity.modules.ai": "1.0.0",
    16.     "com.unity.modules.androidjni": "1.0.0",
    17.     "com.unity.modules.animation": "1.0.0",
    18.     "com.unity.modules.assetbundle": "1.0.0",
    19.     "com.unity.modules.audio": "1.0.0",
    20.     "com.unity.modules.cloth": "1.0.0",
    21.     "com.unity.modules.director": "1.0.0",
    22.     "com.unity.modules.imageconversion": "1.0.0",
    23.     "com.unity.modules.imgui": "1.0.0",
    24.     "com.unity.modules.jsonserialize": "1.0.0",
    25.     "com.unity.modules.particlesystem": "1.0.0",
    26.     "com.unity.modules.physics": "1.0.0",
    27.     "com.unity.modules.physics2d": "1.0.0",
    28.     "com.unity.modules.screencapture": "1.0.0",
    29.     "com.unity.modules.terrain": "1.0.0",
    30.     "com.unity.modules.terrainphysics": "1.0.0",
    31.     "com.unity.modules.tilemap": "1.0.0",
    32.     "com.unity.modules.ui": "1.0.0",
    33.     "com.unity.modules.uielements": "1.0.0",
    34.     "com.unity.modules.umbra": "1.0.0",
    35.     "com.unity.modules.unityanalytics": "1.0.0",
    36.     "com.unity.modules.unitywebrequest": "1.0.0",
    37.     "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    38.     "com.unity.modules.unitywebrequestaudio": "1.0.0",
    39.     "com.unity.modules.unitywebrequesttexture": "1.0.0",
    40.     "com.unity.modules.unitywebrequestwww": "1.0.0",
    41.     "com.unity.modules.vehicles": "1.0.0",
    42.     "com.unity.modules.video": "1.0.0",
    43.     "com.unity.modules.vr": "1.0.0",
    44.     "com.unity.modules.wind": "1.0.0",
    45.     "com.unity.modules.xr": "1.0.0"
    46.   }
    47. }
    48.  
     
    Last edited: Aug 14, 2022
  11. Brainshack

    Brainshack

    Joined:
    Mar 1, 2013
    Posts:
    33
    I also tried creating a custom shader graph, and am getting the same errors.
     
  12. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    This invalidates the theory that the problem (if it has the same cause) is with Linux Vulkan shaders.

    The error message is a bit unspecific. Maybe UT should make a unique one for each problem/issue. Would make it easier to diagnose and fix the problem on both sides. And I'm a bit worried that this happens with stuff provided by Unity (shaders, models, materials, project templates).

    @Brainshack would you file a bug report? I'm not on an officially supported Linux distribution and fear that my report would be ignored because of that. You can link to this topic to show that others suffer from this too. Thanks.
     
  13. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    Are you also getting the same "unable to unroll loop" error message?
     
  14. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    @Brainshack: note that this message did NOT appear right away for me, but when I compiled the shader variants. So maybe try that and see if this happens for you too. Jussi refers to post #5.
     
  15. Brainshack

    Brainshack

    Joined:
    Mar 1, 2013
    Posts:
    33
    So in short: Yes.

    What I did was, copy the URP package to packages folder as described above and then try to compile the Lit Shader. However, after letting it run for over 45 minutes the compilation did not finish and I had to kill the Editor from Task Manager. After restarting then I got the error messages described above when clicking on the shader.

    I just realized however that I was not using the latest LTS version. Was on .6 and now am updating to .8. Maybe thats helping.

    EDIT: Updatiing to .8 did not change anything..
     
  16. Brainshack

    Brainshack

    Joined:
    Mar 1, 2013
    Posts:
    33
    Not sure how I would report a bug?
     
  17. Brainshack

    Brainshack

    Joined:
    Mar 1, 2013
    Posts:
    33
    Another small update:

    I created a new project using 2020 LTS. Getting the same issue.
     
  18. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
  19. Brainshack

    Brainshack

    Joined:
    Mar 1, 2013
    Posts:
    33
    I reported a bug. For reference, the issue ID is IN-14089
     
    exiguous likes this.
  20. Brainshack

    Brainshack

    Joined:
    Mar 1, 2013
    Posts:
    33
    As stated earlier, I tried creating a project in 2020.

    Turns out I made a mistake when creating the project and it still was 2021 LTS.

    In 2020 LTS I dont get the error, with the same version of the hybrid renderer.

    My assumption is that it might be an issue with URP that was introduced in a later version? 2020LTS uses URP version 10, while 2021 LTS uses 12. @exiguous maybe you should give 2020 a try?
     
  21. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    Thanks for bugreporting and verifying. But this was the second showstopperbug I encountered with a fresh project using ECS (first issue was fixed in latest patch). So I think I will give ECS some more time to "mature" and evolve and wait for 1.0. I just don't have time to waste with such issues. I understand when somethin goes wrong and it is my fault. But those bugs just kill a project since I can't fix them, can't work around them and as you see get no real "support" which enables me to proceed. And I don't even have "hardcore" usecases. Just using stuff coming with Unity. It's just disappointing and too buggy for me. I see people developing games and frameworks for ECS. So maybe the issue is still on my side. But as it is now it's just not my cup of tea.
     
  22. tchamblee67

    tchamblee67

    Joined:
    Sep 2, 2017
    Posts:
    3
    Confirmed for me as well. I hit the same problem with the URP/Unlit shader in 2021 LTS but things are working in 2020 LTS with same version of the hybrid renderer package.
     
    Last edited: Aug 22, 2022