Niagara Plexus

Hi I am currently learning ue4 and real time vfx, specifically niagara because I think its a really powerful system once you understand how it works. At the moment I am trying to implement a plexus effect,
like in this video;

https://www.youtube.com/watch?v=x9d6CpEZBdc

But I am struggling with how niagara works. The way I understand the effect is that you need to measure all distances (with pythagoras?) to all particles at all times and than decide by a threshold variable if you want to draw a connection or not. Not really sure if this is the best way but at least it would be a starting point.

How can I access all particle positions in a module script? The way I understand niagara is that you can only get the values of the currently processed particle in a script.

I tried creating a struct with an array of vectors to write all the positions of all particles but as soon as I try to write to the struct in niagara ue4 crashes.

Would appreciate some help or ideas on how to achieve something like this in niagara.

1 Like

The video you sent isn’t what you think it is. He is essentially manualy calculating and setting values per particle.

You can use particle id to find a unique value per particle.

Ahh I see…okay so it wouldn’t work on any other particle simulation?!
Thank you for clearing that up for me.

Can you maybe show me a screenshot of what you mean? I tried looking for nodes like ‘get particle position’ with an I.D parameter field or something similar but can’t seem to find anything.

I haven’t done any of this myself, I’m just aware of the technique used by the video creator.

That being said, for now, you cannot sample particle positions of other id’s, instead you ask for your own id, use it to generate position data that is unique to the id (probably using a hash to find offset data, (sin(hash(id)))*particles.Age, etc etc.

Id’s run from 0 to particle amount, so now you know every position for every particle in you system without haivng to sample it.

Thank you I will try what you said. Probably have to come back here to ask more questions because I’m not entirely sure I completely understand haha but ok thats how I can learn at least.
Do you think it would be possible with what I said in my first post? Writing out all positions to an array and try to go from there? Maybe I will try with 4.25 preview version to get rid of the crashing I had when I tried this way! But then I wouldnt have to set positions…let forces do the position calculations

I might be mistaken, but I don’t believe niagara lets you use arrays in the way you describe.

cgshow guy has a tute he jsut posted a few days ago - go to his youtube channel

They added particle attribute readers.
Making a plexus effect right now, involves reading the position of two particles using the atribute reader and stretching a piece of geometry between that.