unitycoder/UnityPointCloudViewer

UI World Canvas

slacker-jake opened this issue · 3 comments

Hi,

Thank you for your plugin however I have a problem I hope I can have solved. The PointCloud is rendering fine but as soon as a WorldSpace Canvas with an Image/Text inside the bounds of the MainCamera the position of the point cloud is reset to that Canvas element location.

Have you seen or encountered this?

Thanks, Jake

p.s Running in URP

if you can try this, it fixes the issue for me:
#126

(if you have newer unity version, or urp, let me know which one, if that code doesn't work there)

unity confirmed this as a bug also,
https://issuetracker.unity3d.com/issues/graphics-dot-drawproceduralnow-from-onrenderobject-breaks-when-worldspace-canvas-is-in-cameras-view

and gave one workaround:
"I have noticed that creating a new Universal RP project and reimporting your Assets folder makes the drawing render as intended."

unity added more info, that its by design:

After a further resolution with developers, we have decided that this issue is By Design due to the following reasons:
The procedural geometry is being rendered after the UI panel so it is using the UI panel's transform, which is by design. The docs for https://docs.unity3d.com/2019.1/Documentation/ScriptReference/Graphics.DrawProceduralNow.html explain "Note that this call executes immediately, similar to Graphics.DrawMeshNow. It uses the currently set render target, transformation matrices and shader pass".

https://docs.unity3d.com/ScriptReference/Graphics.DrawProcedural.html or https://docs.unity3d.com/ScriptReference/Rendering.CommandBuffer.DrawProcedural.html may be more suitable for this use case.