09-01-2020, 03:33 PM
(This post was last modified: 09-01-2020, 03:34 PM by josemendez.)
(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.