Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Resolved HybridRenderer V2 bug on Android

Discussion in 'Graphics for ECS' started by Lieene-Guo, Dec 1, 2020.

  1. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    547
    Hybrid Renderer Can not render anything on Android build when Using Custom ShaderGraph (which is attached).
    Unity 2020.1.15f1c1, URP 9.0.0-preview.72 ShaderGraph 9.0.0-preview.72, Hybrid Renderer 0.10.0-preview.21.
    ENABLE_HYBRID_RENDERER_V2 defined.
    Enable GPU Instancing is checked on material.
    Hybrid Instance Checked on a Custom Color shader property.
    Working in editor. Working in Windows and IOS Builds.
    Error reported in Android build and no RenderMeash is rendered at all.
    (Companion TrailRenderer is rendered) game logic is running correctlly.
    2020/12/01 13:57:00.425 31955 32106 Error Unity A Hybrid Renderer V2 batch is using the shader "FC2/Lit_URP", 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.
    2020/12/01 13:57:00.425 31955 32106 Error Unity UnityEngine.Rendering.ScriptableRenderContext:Submit_Internal_Injected(ScriptableRenderContext&)
    2020/12/01 13:57:00.425 31955 32106 Error Unity UnityEngine.Rendering.ScriptableRenderContext:InitializeSortSettings(Camera, SortingSettings&)
    2020/12/01 13:57:00.425 31955 32106 Error Unity UnityEngine.Rendering.ScriptableRenderContext:InvokeOnRenderObjectCallback_Internal_Injected(ScriptableRenderContext&)
    2020/12/01 13:57:00.425 31955 32106 Error Unity UnityEngine.Rendering.Universal.UniversalRenderPipeline:RenderSingleCamera(ScriptableRenderContext, CameraData, Boolean)
    2020/12/01 13:57:00.425 31955 32106 Error Unity UnityEngine.Rendering.Universal.UniversalRenderPipeline:RenderCameraStack(ScriptableRenderContext, Camera)
    2020/12/01 13:57:00.425 31955 32106 Error Unity UnityEngine.Rendering.Universal.UniversalRenderPipeline:Render(ScriptableRenderContext, Camera[])
    2020/12/01 13:57:00.425 31955 32106 Error Unity UnityEngine.Rendering.RenderPipeline:InternalRender(ScriptableRenderContext, Camera[])
    2020/12/01 13:57:00.425 31955 32106 Error Unity UnityEngine.Rendering.RenderPipelineManager:DoRenderLoop_Internal(Rend

    PS. on IOS build this warning message is spawned repeatedly(hundreds per second)
    Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = n)
    tracing back to internal render jobs.
    But there are no error. And everything renders Okay.

    Edit:
    upload_2020-12-1_14-21-23.png
    This error appears when PowerNode is used in the graph under Android platform. It disappears when the save graph is pressed. Looks like some internal shader lib has naming conflict. it could lead to the Error in Android Build.
    EDIT:
    That was a GLES2 problem. remove GLES2 Render API will fix it!
     

    Attached Files:

    Last edited: Dec 10, 2020
    Occuros and Opeth001 like this.
  2. Occuros

    Occuros

    Joined:
    Sep 4, 2018
    Posts:
    303
    I have the same, even built-in renderers don't seem to work at the moment:

    Code (CSharp):
    1. Renderer V2 batch is using the shader "Universal Render Pipeline/Lit", but the shader is either not compatible with Hybrid Renderer V2
    even when upgrading to 2020.20b14, the rendering doesn't work at the moment.

    I really hope it will be improved soon as the `DisableRendering` is really useful.

    It was planned to have it compatible with mobile devices in 2020.2

    => Mobile device and console platform support will be validated in 2020.2.

    Hopefully, those plans haven't changed yet.
     
  3. Occuros

    Occuros

    Joined:
    Sep 4, 2018
    Posts:
    303
    Switching Vulkan Renderer (and removing GLES 3) solved it.

    All shaders now work :)
     
  4. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    547
    Yes I found it too.
    That was a GLES2 problem. remove GLES2 Render API will fix it!
     
  5. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    Now sure if Vulkan only is going to be viable for many of us. Looks like 45% of the user's devices don't support it :(

    upload_2020-12-12_2-52-15.png
     
    lclemens likes this.
  6. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    547
    Both GLES3 and Valkan work, It's just GLES2's problem.
    And that a hidden experimental packaged just validated for pc mac standalone build but not mobile. mobile validation in planed in 2020.2 cycles.
    Easy man.
     
    nicolasgramlich likes this.
  7. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    765
    So you guys are able to build for Android with HRV2?? I'm jealous! I've been trying off-and-on for months now and have yet to get barely more than a blank HRV2+URP project to run without crashing. I haven't been able to get anything running since HRV1 (and it ran horribly with HRV1). I would LOVE to be able to test and run on Android again!

    Are you guys using mono or il2cpp? Are there any special settings that you recall having set or any special packages that you needed to install?

    The most recent thing that's been holding me up is setting a physics shape to mesh causes Android builds to crash when loading the scene.
     
  8. joelv

    joelv

    Unity Technologies

    Joined:
    Mar 20, 2015
    Posts:
    203
    Android builds should be working. I spent some time two weeks ago running our internal test scenes on android ironing out bugs for the 0.17 dots release.

    If you build for any dots stand alone player you need to use the new build configuration setup. Create -> Build -> Android Classic Build Configuration
     
    BuzzJive likes this.
  9. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    765
    I would love to get it working on Android! I have tried building with "Android Classic Build Configuration" several times, but the crash still happens. Unfortunately, when building via the "Build and Run" button in the Inspector window of the properties of "Android Classic Build Configuration" the logcat window doesn't display, so I don't know what causes the crash in that case.

    I'm just trying to build a simple project that contains one sphere and physics shape. I have built for Android hundreds of times using HRV1. The only time I can get it working with HRV2 is when I remove the physics shape from the sphere.

    Here is a zip of the project that crashes on Android (it's only 83KB): https://drive.google.com/file/d/15UgsWwa8hePDUxzqvIWZqYBGN6L7Rvjf/view?usp=sharing Maybe if someone has time they can build and try to run on Android quick... maybe there's a setting or something I need to change that I didn't know about. Or perhaps it's my phone... I only have one Android phone right now and it's a middle-of-the-road Motorola X4.
     
  10. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    Well, might as well give it a shot again with 0.17. Performance was about 30% lower the last time I tried V2 successfully.

    @joelv which Unity version did you use in your tests? Last time i tried 2020.2.0.b14 Subscenes were completely broken, even in the editor (Case 1297351) :(
     
  11. joelv

    joelv

    Unity Technologies

    Joined:
    Mar 20, 2015
    Posts:
    203
    30% lower compared to what?

    I think the subscene bug fix landed in b15, I used that and f1 for testing. There where some other hybrid specific subscene bugs that was fixed late in the 0.17 release procedure as well, so waiting for the final packages.
     
  12. BuzzJive

    BuzzJive

    Joined:
    Mar 6, 2014
    Posts:
    75
    This is very unclear in the sample project and a bit frustrating when the scenes seem to build, but the subscenes do not - and there's seemingly no error or warning when it should be attempting to load the subscene but failing.