- Home /
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. Without GraphicsSettings.renderPipelineAsset
and using Camera.onPostRender
Scene and Game views are rendered the same way. 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.
Also is the URP/Renderer Features supported on mobile? I can get it to work on desktop win/osx (disabling PP) but it still doesn't work in ios/mobile.
Answer by ajeziak · Feb 20, 2020 at 02:08 PM
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.
I've rebuilt my camera and it seems that when AA is set to None/S$$anonymous$$AA things break. FXAA works as expected.
Your answer
Follow this Question
Related Questions
NullReference : UniversalRenderPipelineCameraEditor.cs:207 2 Answers
How to do texture bombing in shader graph 0 Answers
Help with Android Build ! 1 Answer
Why is the Canvas not showing up on device in ARFoundation using URP? 0 Answers
HDR data is not rendered into render texture when using URP 2 Answers