Search Unity

Null reference and crash with URP + Postprocessing + Android (Quest 2)

Discussion in 'Universal Render Pipeline' started by Brady, Oct 12, 2020.

  1. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    I'm receiving the following error at runtime on Quest 2:
    Code (csharp):
    1. NullReferenceException: Object reference not set to an instance of an object.
    2. at UnityEngine.Rendering.Universal.Internal.PostProcessPass.Render (UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.Universal.RenderingData& renderingData) [0x00000] in <00000000000000000000000000000000>:0
    3. at UnityEngine.Rendering.Universal.Internal.PostProcessPass.Execute (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.RenderingData& renderingData) [0x00000] in <00000000000000000000000000000000>:0
    4. at UnityEngine.Rendering.Universal.ScriptableRenderer.ExecuteRenderPass (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.ScriptableRenderPass renderPass, UnityEngine.Rendering.Universal.RenderingData& renderingData, System.Int32 eyeIndex) [0x00000] in <00000000000000000000000000000000>:0
    5. at UnityEngine.Rendering.Universal.ScriptableRenderer.ExecuteBlock (System.Int32 blockIndex, Unity.Collections.NativeArray`1[T] blockRanges, UnityEng
    This is with:
    Unity 2019.4.12f1
    URP 7.5.1
    Integrated Postprocessing stack (Bloom only)
    OpenGLES3

    All works fine in editor, but spams the above error to the android logcat shortly before locking up the device entirely, requiring a hard shut-down and reboot of the device.
     
    BAIZOR likes this.
  2. Rarceth

    Rarceth

    Joined:
    Oct 15, 2015
    Posts:
    41
    You ever figure this one out? I can fix it by turning off post on the center cam, but id rather have my FXAA :p
     
  3. BAIZOR

    BAIZOR

    Joined:
    Jul 4, 2013
    Posts:
    112
    Have the same issue
     
  4. SergentMT

    SergentMT

    Joined:
    Mar 14, 2017
    Posts:
    11
    I have the same issue - Did you find any solutions?
     
  5. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    We wound up excluding from compilation all lines pertaining to a second / post processing pass when compiling for Android, in addition to upgrading to URP 7.7.1.
     
  6. SergentMT

    SergentMT

    Joined:
    Mar 14, 2017
    Posts:
    11
    @Brady Thanks a lot, much appreciated! That got me on the right track and my problem is now resolved.

    For future reference:
    The Universal Renderer data asset (the one where you set custom passes) had some old lingering Renderer features in it, which did NOT show in the inspector, but where only visible when the asset was chosen in the Project view (it shows as foldout objects of the Universal Renderer asset).
    The scripts for these renderer features where still in the assets. Deleting the scripts did not work for me, as Unity started spewing out errors, so as Brady suggested, I uncommented all code in these scripts (just all the content of the functions), recompiled and hit build and now it is working.
     
    Montie68 and Brady like this.