Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException with ComputeBuffer and Disc shader using Universal Render Pipeline (URP) #59

Open
bjornsyse opened this issue Oct 20, 2020 · 3 comments
Assignees
Labels

Comments

@bjornsyse
Copy link

Hi, I get this error when using Universal Render Pipeline and the ComputerBuffer type of rendering.

Discs show up in editor, but not in Game view and this error is thrown

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

@keijiro keijiro self-assigned this Oct 20, 2020
@roblms
Copy link

roblms commented Mar 5, 2021

Same problem here, using Unity 2020.2.2f1, Universal RP 10.2.2.

The issue appears to be this line

var camera = Camera.current;

modifying it to use Camera.main appears to solve the issue.

@smokelore
Copy link

smokelore commented Aug 23, 2021

@keijiro is setting var camera = Camera.main the correct solution here? I am running into the same problem.

@Angratharr
Copy link

I have this same issue and tried modifying the PointCloudRenderer script to the above suggestion. However, the change reverts back because the package gets revalidated (I think).

here is the warning: The package cache was invalidated and rebuilt because the following immutable asset(s) were unexpectedly altered:
Packages/jp.keijiro.pcx/Runtime/PointCloudRenderer.cs

How can I apply this fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants