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

Add neighbor search phase #1

lmontoute opened this Issue Jan 7, 2019 · 0 comments


1 participant
Copy link

lmontoute commented Jan 7, 2019

Currently, the neighbor search phase for simulation is disabled. This is crucial for performance with higher particle counts. In order to implement we'll need to figure out one of the following:

  1. Add and bind an additional read/write buffer (or texture) to the VFX compute shader
  2. Somehow use custom attributes to store neighbor information

So far I've (unsuccessfully) experimented with a few hacks by rewriting the shader to force texture inputs as RW. As expected, this results in lots of crashes 🙂

Looking through the VFX graph source, it seems adding a buffer may be possible, but there is no API for this at all. We'd need to hook into/patch the data at a pretty low level before it gets sent to the engine. Right now all of these are very internal, so I've held off here in the hopes that a solution will manifest on Unity's end.

Solution 2 may work, but the biggest issue here is the differences in size between partitioning structure (grid or linked list), and the neighbor data (sized as a multiplier on particle count). So it is likely that we will need either both solutions 1 and 2, or just solution 1.

I'm open to any thoughts for any of these, or new creative ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment