Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
2d Line Renderer Not Updating
#5
(09-01-2020, 11:46 AM)LORDeveloper Wrote: Same thing here usingĀ 

Unity 2019.3 with Universal Render Pipeline. When I change the length, it doesn't update at all with line render


I have clicked on the scene view in order to make the rope render. And it ignores my UV settings.


When I press "Play", it just disappears. And I have to click on the scene view again to show again.


When I change the length, the rope doesn't get updated.

Seems that unlike the built-in pipeline, URPs do not call Camera.onPreCull. Since the line renderer relies on this callback to render the view-dependent mesh, in URP it is not drawn.

Instead, URP calls RenderPipelineManager.beginCameraRendering.

In ObiRopeLineRenderer.cs, declare a renderCallback delegate:
Code:
System.Action<ScriptableRenderContext, Camera> renderCallback;

Replace "Camera.onPreCull += UpdateRenderer;" in ObiRopeLineRenderer.cs OnEnable() method with this:

Code:
renderCallback = new System.Action<ScriptableRenderContext, Camera>((cntxt, cam) => { UpdateRenderer(cam); });
RenderPipelineManager.beginCameraRendering += renderCallback;

And similarly, replace "Camera.onPreCull -= UpdateRenderer;" in OnDisable with this:
Code:
RenderPipelineManager.beginCameraRendering -= renderCallback;

That should get rid of the issue. Will include this fix in the next update.
Reply


Messages In This Thread
2d Line Renderer Not Updating - by Bluerex - 30-12-2019, 03:09 AM
RE: 2d Line Renderer Not Updating - by josemendez - 30-12-2019, 04:33 PM
RE: 2d Line Renderer Not Updating - by Bluerex - 30-12-2019, 10:35 PM
RE: 2d Line Renderer Not Updating - by josemendez - 09-01-2020, 03:33 PM