• Advertisement
Sign in to follow this  

Bunching spawned particles in a particle generator

This topic is 4334 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
Share on other sites

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


n_particles = 1000
life_span = 500ms;
bunching = 1;
t = 500ms;
every (500 ms) spawn (1-0) * 1000 = 1000 particles

life_span = 6000ms
bunching = 0.5
t = 3000ms
every (3000ms) spawn 0.5 * 1000 = 500 particles

life_span = 800
bunching = 0.1
t = 80
every (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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement