Repair ribbon hole
The intention of those mini tutorials is to have simply searchable reference for the implementation of fundamental concepts in Niagara.
At the moment I need to have a fast have a look at how we would remedy a typical challenge when utilizing Ribbons.
Until you spawn a particle each single body, there’ll all the time be a niche between the supply of the ribbon and the ribbon itself.
Spawning a particle each body, could be a resolution in some instances, nevertheless it’s usually higher to discover a resolution in which you’ll be able to bridge that hole
There are a couple of methods to cope with this, however I’d prefer to current a reasonably fundamental one that may work in a lot of conditions.
Fundamental Setup
The technique right here shall be to reliably discover the final spawned particle and snap it to our supply location (the emitter place on this instance).
We do that by, for each particle, evaluating the index of that particle with the whole variety of particles which have been spawned within the emitter. Within the case that we do have the final spawned particle, we set the Place of the particle to the simulation place.
Now to know the whole variety of particles we nonetheless have to maintain observe of that someway.
To do that, we’ll regulate the SpawnPerUnit and SpawnRate modules. (You’ll in all probability need to create a duplicate for this.)
On the finish of the modules we will add a bit of part that reads the spawn depend and provides it to Emitter.TotalParticlesSpawned.
And growth now the final particle of your ribbon will stay hooked up to the supply.
Besides that’s not completely the case.
As a consequence of tick order it’s potential that this script shall be executed earlier than the motion script of the supply.
This will create a one body hole between the final particle and the supply.
We will remedy this on a case by case foundation, by forcing the Niagara Tick to later within the body.
That is typically ailing suggested as a result of it takes away the engines capacity to utilize threading in an environment friendly means, but when used sparingly it may be useful.
And there you go, a fairly strong option to make your ribbons gap-less.
Get pleasure from.
15 Likes
After GPU Ribbon is obtainable to Niagara I’m now not too bothered with this challenge, however I nonetheless need to share a much less correct however barely simpler resolution to the hole challenge when utilizing Spawn Charge.
This method assumes the consumer to stay with a relentless spawn charge worth, as a result of there may be little or no level of randomizing the spawn charge worth each body in a ribbon emitter. Anyway as a result of the spawn charge worth is fixed, we will merely calculate the spawn interval in second by 1/SpawnRateValue, then in Particle Replace stage, do a Lerp Place and select between SimulationPosition and Particles.Preliminary.Place (or simply Particles.Place is dependent upon your use case) by checking if the Particles.Age is smaller than the spawn interval.
3 Likes
@ifurkend Humorous sufficient, somebody asking how you can do your described technique for spawn per unit, is what triggered me to search for the introduced technique.
1 Like
If we’re speaking about the identical man, he truly wished the most recent particle to transcend the actor place, which is feasible with our strategies, nevertheless it saddens me that it now not issues now (not due to the GPU ribbon).
That is truly the identical technique as Partikel’s tip proper, simply not finished in scratchpad
and thanks for the nice tip as nicely Niels!
1 Like
I’ve a query, as a result of I’m unable to learn what’s earlier than this (or extra like they’re too superior!), what does SpawnOutputInfo return? To my understanding, it appears you’re taking out the each depend of particle spawn and accumulate them to the Emitter.TotalParticlesSpawned.
It could be nice in case you may clarify extra about this half, thanks.
it appears you’re taking out the each depend of particle spawn and accumulate them to the Emitter.TotalParticlesSpawned.
Yup, that’s precisely what we’re doing.
Spawn data is the construction a spawn module passes onto the engine to point that it needs to spawn new particles.
For those who open up one of many epic offered spawn modules, you’ll discover that the final node in these modules is the one I marked in white.
So we merely copy the epic present modules and put these nodes within the image behind it to examine what number of particles this modules needs to spawn and add it to our depend.
1 Like
Hi there Niels!
I attempted your tutorial however for the second half (fixing the spawn charge or spawn per unit) when compiling the module script it tells me there may be errors :
I’m unsure what to do since two of them are positioned on nodes that got here from the fundamental spawn charge module. The final one is the map set on the finish (the one you add) however I suppose this error is attributable to the 2 others errors.
Are you able to assist me please ?
Chances are high your module utilization flags haven’t been set completely to emitter.
I discovered this challenge when spawning with the hole repair. Particles aren’t distributed evenly accross the path, I suppose it’s associated to delta time. How do you recommend to repair this?
If you’d like equal spacing, you should utilize a variation that snaps again the particle to it’s unique spawn place as soon as it’s now not the final one.