Pcx icon indicating copy to clipboard operation
Pcx copied to clipboard

LWRP: ComputeBuffer doesn't render in camera

Open gameanimation3d opened this issue 4 years ago • 6 comments

With the New LWRP. The Pointcloud in ComputeBuffer Mode doesn't render in the Camera. Only in Editor the Pointcloud gets correctly drawn. If i switch back to builtin Renderpipeline everything works fine.

Mesh Rendering in LWRP works. But doesn't apply an Point Size.

Unity Version: 2019.2.8f1 Pcx Version: Release Version v1.2

additionally i get the following warning

GarbageCollector disposing of ComputeBuffer allocated in M:\Repo\GitRepos\SFMVisualizer_dev\SFMVisualizer_Unity\Assets\Pcx\Runtime\PointCloudData.cs at line 27. Please use ComputeBuffer.Release() or .Dispose() to manually release the buffer. UnityEngine.ComputeBuffer:Finalize() (at C:/buildslave/unity/build/Runtime/Export/Shaders/ComputeShader.bindings.cs:28)

gameanimation3d avatar Oct 10 '19 07:10 gameanimation3d

Only in Editor the Pointcloud gets correctly drawn.

So, you meant that this issue only reproduces on a built app?

Which platform are you using? Windows, macOS or mobile platform?

keijiro avatar Oct 10 '19 10:10 keijiro

So, you meant that this issue only reproduces on a built app?

No. The pointcloud gets only drawn in the Editor View. In the Game View in Editor it doesn't show up. I didn't tested it it an Build app

Which platform are you using? Windows, macOS or mobile platform?

As OS Windows 10 64bit - Build Settings are for Windows

gameanimation3d avatar Oct 10 '19 11:10 gameanimation3d

Have the same issue. Even get a nullReferenceExection on play. Something with the camera?

NullReferenceException: Object reference not set to an instance of an object
Pcx.PointCloudRenderer.OnRenderObject () (at Assets/Pcx/Runtime/PointCloudRenderer.cs:88)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

bjornsyse avatar Jul 07 '20 16:07 bjornsyse

Did you manage to solve the problem?

ahwemorela avatar Dec 13 '22 07:12 ahwemorela

Struggling with the same issue in HDRP. Is there no solution yet?

StrikeAgainst avatar Jul 26 '23 16:07 StrikeAgainst

Update as per this thread I opened on the Unity forums: OnRenderObject does not seem to get triggered with HDRP (possibly LWRP and any other scriptable pipeline as well), thus you have to attach the rendering process to the manager yourself. Worked fine for me after doing so.

StrikeAgainst avatar Jul 31 '23 13:07 StrikeAgainst