Search Unity

Exiting Play Mode causes render error (HDRP)

Discussion in 'High Definition Render Pipeline' started by MafiaMoe, Aug 3, 2019.

  1. MafiaMoe

    MafiaMoe

    Joined:
    Mar 24, 2013
    Posts:
    27
    We are using 2019.2 and SRP packages updated to 6.9.1.

    In our situation, the scenes render fine in the editor scene and game windows when first loaded. After exiting play mode we get the following 2 errors and nothing displays in either scene or game windows:

    NullReferenceException: Object reference not set to an instance of an object
    UnityEngine.Experimental.Rendering.HDPipeline.HDRenderPipeline.LightLoopUpdateCullingParameters (UnityEngine.Rendering.ScriptableCullingParameters& cullingParams) (at Library/PackageCache/com.unity.render-pipelines.high-definition@6.9.1-preview/Runtime/Lighting/LightLoop/LightLoop.cs:1717)
    UnityEngine.Experimental.Rendering.HDPipeline.HDRenderPipeline.TryCalculateFrameParameters (UnityEngine.Camera camera, UnityEngine.Experimental.Rendering.HDPipeline.XRPass xrPass, UnityEngine.Experimental.Rendering.HDPipeline.HDAdditionalCameraData& additionalCameraData, UnityEngine.Experimental.Rendering.HDPipeline.HDCamera& hdCamera, UnityEngine.Rendering.ScriptableCullingParameters& cullingParams) (at Library/PackageCache/com.unity.render-pipelines.high-definition@6.9.1-preview/Runtime/RenderPipeline/HDRenderPipeline.cs:2259)
    UnityEngine.Experimental.Rendering.HDPipeline.HDRenderPipeline.Render (UnityEngine.Rendering.ScriptableRenderContext renderContext, UnityEngine.Camera[] cameras) (at Library/PackageCache/com.unity.render-pipelines.high-definition@6.9.1-preview/Runtime/RenderPipeline/HDRenderPipeline.cs:1043)
    UnityEngine.Rendering.RenderPipeline.InternalRender (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Camera[] cameras) (at C:/buildslave/unity/build/Runtime/Export/RenderPipeline/RenderPipeline.cs:72)
    UnityEngine.Rendering.RenderPipelineManager.DoRenderLoop_Internal (UnityEngine.Rendering.RenderPipelineAsset pipe, UnityEngine.Camera[] cameras, System.IntPtr loopPtr, Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle safety) (at C:/buildslave/unity/build/Runtime/Export/RenderPipeline/RenderPipelineManager.cs:67)

    XRSystem.ReleaseFrame() was not called!
    UnityEngine.Rendering.RenderPipelineManager:DoRenderLoop_Internal(RenderPipelineAsset, Camera[], IntPtr, AtomicSafetyHandle)​

    Strangely, when entering play mode a second time the rendering works again, but exiting play mode causes the same errors and nothing is rendered. Reloading the scene doesn't fix it. The only fix we have found is restarting Unity.

    I have loaded up the HDRP demo project and it works normally. I have tried different scenes in our project, but they all behave the same. I have also tried re-creating a new HDRPasset and reimporting all packages. This seems to point at the issue being some setting in our project, but I haven't been able to track it down. Any help would be greatly appreciated.
     
    Last edited: Aug 3, 2019
  2. MafiaMoe

    MafiaMoe

    Joined:
    Mar 24, 2013
    Posts:
    27
    I just discovered that changing a script and rebuilding temporarily fixes the issue, until entering play mode and exiting.
     
  3. Eloujah

    Eloujah

    Joined:
    Apr 28, 2014
    Posts:
    24
    Hi, I have pretty much the same problem...
    But with my project, all the rendering stops when a scene is loaded.
    I hope the Unity team will find a fixe soon
     
  4. mrmiketheripper

    mrmiketheripper

    Joined:
    Mar 13, 2019
    Posts:
    6
    Coming to say me too on macOS 10.14.6 on 2018 MacBook Pro. Using HDRP render profile. Not using any particles with light modules enabled on them. Sometimes my rendering will stop all together and sometimes it wont, if my rendering stops I need to restart my computer to get it back. This is a on a project that was upgraded to HDRP recently (didn't have any such issues on LWRP but damn that 16 point light limit)
     
  5. bonickhausen

    bonickhausen

    Joined:
    Jan 20, 2014
    Posts:
    115
    Still happening.
     
  6. RogueSunOrg

    RogueSunOrg

    Joined:
    Aug 29, 2014
    Posts:
    1
    Are you using the SlightBlur (or other) custom pass? I had this error and noticed that in the Cleanup method the maskDepthBuffer.Release() wasn't checking that maskDepthBuffer wasn't null, and changing it to maskDepthBuffer?.Release() fixed the problem.