Niagara Particle Interaction

I would like my particles to interact with each other on the GPU. I see there is some work on NieghborGrid3D, which might be a way to find neighboring particles. How can I access another particle, in a particle update module, by its index? I suspect that this is not possible.

For example, I would like to implement a boid simulation. This requires particles to reference and access the position and attributes of neighboring particles.

Hi Timtimmy,

Have you found a solution for this problem yet?

I’m very interested in this too - intially just how to access a particle by index would be v useful. I suspect the data might have to be read from the previous frame

Unfortunately, this is not possible in Niagara. Unreal does not give us access to the uniform particle buffer from within the visual scripting system (or I couldn’t figure it out). Perhaps it could be hacked from C++ and hlsl, but that defeats the purpose of this beautiful scripting system. #FeatureRequest.

I was curious about the possibility of using Niagara as an entity-component system (ECS, the data oriented technology stack thing that Unity devs are so excited about) on steroids. I wrote a high performance CPU based ECS for Unreal as part of my PhD (>10,000 agents simulating at 90 fps in VR), and now I’m in the early steps of porting that to the GPU. No promises that this will go anywhere, yet, but I’m pretty excited. I have no plans for a visual scripting system at this point.

My early experiments have 0.5 million boids running on the GPU. There are two critical components to getting this performance. Instanced rendering directly from position and transform buffers stored on the GPU (I will release this code soon), and an efficient neighbourhood queries based on a hashed dynamic grid implementation that I borrowed from a realtime fluid simulation implementation.

There is such feature, google for Niagara Neighbour Grid3D. You can inject data into 3d Grid and read it from it. I don’t see much usecases of ECS honestlt, but would be fine to have it just in case