Wednesday, November 29, 2023
HomeVisual Effects Repair ribbon hole Mini Tutorial

[Niagara 5.0] Repair ribbon hole Mini Tutorial


Repair ribbon hole

RibbonFix001

The intention of those mini tutorials is to have simply searchable reference for the implementation of primary concepts in Niagara.

In the present day I need to have a fast have a look at how we’d remedy a typical problem when utilizing Ribbons.
Except you spawn a particle each single body, there’ll at all times be a spot between the supply of the ribbon and the ribbon itself.

Spawning a particle each body, is usually a answer in some instances, however it’s usually higher to discover a answer in which you’ll bridge that hole
There are just a few methods to cope with this, however I’d wish to current a reasonably primary one that may work in numerous conditions.

Fundamental Setup
The technique right here can 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 entire 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 entire variety of particles we nonetheless have to preserve observe of that one way or the other.
To do that, we’ll alter 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 little bit part that reads the spawn rely and provides it to Emitter.TotalParticlesSpawned.

And increase now the final particle of your ribbon will stay hooked up to the supply.

Besides that’s not fully the case.
Resulting from tick order it’s potential that this script can be executed earlier than the motion script of the supply.
This could create a one body hole between the final particle and the supply.
We are able to remedy this on a case by case foundation, by forcing the Niagara Tick to later within the body.
That is usually unwell suggested as a result of it takes away the engines skill to utilize threading in an environment friendly approach, but when used sparingly it may be useful.

And there you go, a fairly strong method to make your ribbons gap-less.

Take pleasure in.




18 Likes

After GPU Ribbon is offered to Niagara I’m now not too bothered with this problem, however I nonetheless need to share a much less correct however barely simpler answer to the hole problem when utilizing Spawn Price.

This method assumes the person to stay with a continuing spawn fee worth, as a result of there may be little or no level of randomizing the spawn fee worth each body in a ribbon emitter. Anyway as a result of the spawn fee 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 will depend on your use case) by checking if the Particles.Age is smaller than the spawn interval.



6 Likes

@ifurkend Humorous sufficient, somebody asking easy methods to do your described methodology for spawn per unit, is what triggered me to search for the offered methodology.



1 Like

If we’re speaking about the identical man, he really needed the latest particle to transcend the actor place, which is feasible with our strategies, however it saddens me that it now not issues now (not due to the GPU ribbon).

That is really the identical methodology as Partikel’s tip proper, simply not accomplished in scratchpad :smiley:
and thanks for the good tip as properly 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 rely of particle spawn and accumulate them to the Emitter.TotalParticlesSpawned.
It might be nice in case you may clarify extra about this half, thanks.

it appears you’re taking out the each rely of particle spawn and accumulate them to the Emitter.TotalParticlesSpawned.

Yup, that’s precisely what we’re doing.

Spawn information is the construction a spawn module passes onto the engine to point that it needs to spawn new particles.
In case you 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 rely.



1 Like

Whats up Niels!

I attempted your tutorial however for the second half (fixing the spawn fee or spawn per unit) when compiling the module script it tells me there may be errors :

I’m undecided what to do since two of them are positioned on nodes that got here from the fundamental spawn fee 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 ?

Likelihood is your module utilization flags haven’t been set solely to emitter.

I discovered this problem 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 counsel to repair this?

If you’d like equal spacing, you should use a variation that snaps again the particle to it’s authentic spawn place as soon as it’s now not the final one.

Hello, sorry for my late anwser however after making an attempt to vary my module utilization I get a number of issues :Even by clearing the namespace I nonetheless get the error (screenshot present what it was earlier than):

for the second because the node was not the identical as yours I take away the half within the center however no success in clearing the error both :

For the final one the flags are good so I don’t perceive the error right here :

I copy/paste the spawn fee module from epic sport so I don’t know the place I did one thing mistaken.

image
Doesn’t look good to me, it’s set as a particle module within the utilization flags.

You’ll need solely Emitter spawn and Emitter Replace

Oooooh I didn’t look there, I really feel a bit foolish now… I additionally had an interrogation : I’ve a missile impact utilizing a ribbon as a path with the occasion handler however there’s a huge hole, does the strategy you present is similar to repair it or is there some adjustments ?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments