keijiro / Pcx

Point cloud importer & renderer for Unity
The Unlicense
1.35k stars 195 forks source link

LWRP: ComputeBuffer doesn't render in camera #34

Open gameanimation3d opened 4 years ago

gameanimation3d commented 4 years ago

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)

keijiro commented 4 years ago

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?

gameanimation3d commented 4 years ago

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

bjornsyse commented 4 years ago

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)
ahwemorela commented 1 year ago

Did you manage to solve the problem?

StrikeAgainst commented 1 year ago

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

StrikeAgainst commented 1 year ago

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.