spawn generates crazy amount of particles?
#1
Hi guys, I am new here. I run into a very weird behavior of the spawn operator. It should be very basic, but I can't find answers in the help doc.

So, I have one emitter that generates only 1 particle, only once, it flies to space at a certain speed.

Then, I added a spawn operator that generates a particle per frame, rate=1.0.

From here, I expect that on the 2nd frame, there should be 2 particles, on the 3rd frame, there should be 3 particles. so on so forth.

But in reality, the particle number increases exponentially. so on the 10th frame, it's already 2048 particles.

I tried the spawn setting: per step, per frame, per second, they all cause the particle number to grow exponentially, as if the particles generated by the spawn operator is being spawned by itself.

[Image: attachment.php?aid=1243]

If I have a 100 frames animation, the number of particles will be too much for my computer. Even after I put a delete operator on it, the number still doesn't make sense. Any idea? Thanks a lot!


Attached Files Thumbnail(s)
   
  Reply
#2
Why wouldn't it generate exponentially? The Spawn operater affects all particles in the event by default, so yes...the children of spawned particles in the same event will generate spawned particles and so on, and thus the particle count will grow exponentially.

The easiest way to avoid exponential growth is to just send spawned particles out to another event using the output connector on the right hand side of the Spawn operator.

Alternatively you could enable some filtering in the Spawn operator to only spawn from certain particles based on criteria of your choosing.
  Reply
#3
(12-28-2020, 10:44 AM)tyFlow Wrote: Why wouldn't it generate exponentially? The Spawn operater affects all particles in the event by default, so yes...the children of spawned particles in the same event will generate spawned particles and so on, and thus the particle count will grow exponentially.

The easiest way to avoid exponential growth is to just send spawned particles out to another event using the output connector on the right hand side of the Spawn operator.

Alternatively you could enable some filtering in the Spawn operator to only spawn from certain particles based on criteria of your choosing.

Thanks for your quick reply. I thought the operator goes from top to bottom, so I naturally assumed that the spawn operator uses the particles generated by the operator above it, and it wouldn't take the particles of the whole event as the source. That's why I thought it was strange.

So, without sending the spawned particles out to another event, it will create an infinite loop within the current event, right? (except for "on entry")

I just tested your approach by sending the output to a new event, it works as intended now. Thank you so much.
  Reply
#4
It won't create an infinite loop, but if you don't move the particles out it will generate exponential growth (up to the limit defined in the operator, which is 1 million particles per step, by default).

Operators are evaluated top to bottom in events, per time step.
  Reply


Forum Jump: