Control particle spawn locations from C++ in Niagara

I am trying to render a point cloud with specific point locations that I have in a file. I know there are some solutions out there focused on photogrammetry data but I think in my situation I need more control in the end. I believe what I want is a particle system in Niagara where particles spawn at the locations from my file. So I believe I need to do the following:

  • Create a particle system and replace the location entry in the particle spawn stack by something that delivers the desired locations
  • Looking at the SphereLocation blueprint it appears that I basically need a node that outputs one location (+metadata) from my file per call and wire the output into Particles.Position

Summing that up I need to write this node for producing the locations. In the SphereLocation BP this is (more or less) done by the Gaussian Random Vector node. But that is a Blueprint and I probably want to do this in C++. I am decently skilled in C++ but lack the Unreal experience so here are my questions:

  • How do I create such a node in C++?
  • Especially, which base class do I need?

Of course, I might be completely on the wrong track here.

Did you make any progress here? I too want to do something very similar.

thank you,
0xf00d

Having the same question

I ended up writing a Niagra Data Interface for my point data, and it works in Niagara beautifully. I originally did all the work for the GPU version too, but in the end I just supported CPU. I used the included source code in SideFX as a template for my class.

0xf00d

Cool! Are you planning to release this maybe? Or share some tutorial at least? Would be nice to have a plugin or something, I need something similar (database with tons of points at specific locations), but I’m not that good at C++! :wink:

I’d also be interested in how you did this!