Rendering issues with RenderPipelineManager.endCameraRendering

Is this a bug in Rendering Pipeline or I’m just missing something?
Using RenderPipelineManager.endCameraRendering this example renders as expected in Scene view, but incorrect (on top of other objects) in Game view.
alt text
Without GraphicsSettings.renderPipelineAsset and using Camera.onPostRender Scene and Game views are rendered the same way.
alt text
Yeah, and the last time I tested it was with Unity 2019.2.0b1 and Lightweight RP 6.5.3

I asked it on the forum first but nobody answered there yet.

Code:

[ExecuteAlways]
public class ExampleClass : MonoBehaviour {
    /* ... https://docs.unity3d.com/ScriptReference/GL.html */
    void OnEnable() {
        // Camera.onPostRender += OnRendered;
        RenderPipelineManager.endCameraRendering += OnRendered;
    }
    void OnDisable() {
        // Camera.onPostRender -= OnRendered;
        RenderPipelineManager.endCameraRendering -= OnRendered;
    }
    private void OnRendered(ScriptableRenderContext context, Camera camera) {
        OnRendered(camera); // OnRenderObject() from https://docs.unity3d.com/ScriptReference/GL.html
    }
}

Update 1: I got it to work correctly, but I needed to change all LWRP asset fields to defaults. Why does unexpected behavior happen when some of these fields are changed: Quality’s HDR and MSAA, Advanced’s SRP Batcher?

For example, it stops rendering (or renders incorrectly) in Game view if HDR is enabled, if SRP Batcher is disabled, if MSAA is enabled.

Oh, just found out that plain GL example from documentation doesn’t work at all with LWRP in Game view. Changing LWRP asset settings doesn’t change anything.

Update 2: Tested Unity v2019.3.0b5 with Universal Render Pipeline v7.1.2 (previously known as LightWeight RP).

First of all you get plain GL example from documentation work in Edit mode (both in Scene and Game views) by adding [ExecuteAlways] to your script - otherwise OnRenderObject is called only in Play Mode.

Secondly SRP Batcher setting doesn’t affect rendering in Game view anymore. But changing settings m_SupportsHDR or m_MSAA to anything but 0 and 1 respectively still stops rendering correctly in Game view. I also noticed that adding Renderer Feature to Renderer - currently there’s only one Render Objects (Experimental) stops rendering correctly too.

Does anyone know if this will be fixed when RP is finalized?

Update 3: Tested Unity v2019.3.0b8 with Universal Render Pipeline v7.1.2.

Noticed that example also doesn’t render correctly in Game view with Enabled Post Processing setting on Camera.

Update 4: Tested Unity v2019.3.0b9 with Universal Render Pipeline v7.1.2.

As noticed by another developer, that example also doesn’t render correctly in Game view with Enabled Opaque Texture setting in URP Asset settings.

Has there been any updates/fixes for the above issues? Hitting this with 2019.3.0f6 #3. As soon as main Camera has PP enabled the material override on RenderObject stops working. Things work correctly in scene view/camera.

Has there been any updates/fixes for the above issues? Hitting this with 2019.3.0f6 #3. As soon as main Camera has PP enabled the material override on RenderObject stops working. Things work correctly in scene view/camera.