# Bunching spawned particles in a particle generator

## Recommended Posts

Hey, does anyone know a formula to bunch particles? I'm thinking, I specify a bunch value between 0 and 1. Assuming the lifetime of a particle will be 500ms, at 0 the particle generator will spawn the entire batch of particles every 500ms and at 1, it will spawn a steady stream. Does anyone know the equation to do this?

##### Share on other sites
I'm not really sure what you're talking about, and it's likely that I won't know how to do it, but for the benefit of everyone else who will come across this thread: perhaps you could explain in greater detail exactly what you're trying to do.

I get that you're attempting to find a forumla that will specify how far apart (in 3 dimensional space) these particles will be from each other.

Quote:
 Assuming the lifetime of a particle will be 500ms, at 0 the particle generator will spawn the entire batch of particles every 500ms and at 1, it will spawn a steady stream.

This I don't understand.

##### Share on other sites
Lets say I have a particle generator, with 16 particles. The particle life, is 16 ms. If bunching is 1, it would spawn one particle every millisecond. If bunching is 0, it would spawn all 16 particles every 16 seconds.

If you have Doom 3, in the particle editor, it is the bunching slider.

Is that clearer?

##### Share on other sites

t = bunching_factor * life_span;
every t spawn bunching_factor*n_particles particles;

n_particles = 1000life_span = 500ms;bunching = 1;t = 500ms;every (500 ms) spawn (1-0) * 1000 = 1000 particleslife_span = 6000msbunching = 0.5t = 3000msevery (3000ms) spawn 0.5 * 1000 = 500 particleslife_span = 800bunching = 0.1t = 80every (80ms) spawn 0.1 * 1000 = 100 particles

Probably not the smoothest solution, but simple enough. The "every t" statement translates into "if (time_since_last_spawn > t) then "

The curve of course is not linear, so you might want to try using sqrt(bunching) or bunching^2 or some other transform to make it more responsive. Obviously, the formula should be limited, so that when bunching is a low value, it always spawns a minimal number of particles based on framerate.

Depending on how you define bunching, you can also use (1-bunching) instead of bunching in above formulas.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
627752
• Total Posts
2978920

• 10
• 10
• 22
• 14
• 14