[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Particle Effects



I read the part about the additive blending. Interesting idea, the sum of all the values of colors in the region would indeed converge to white sometimes... Guess I'll have to use the surfarray module.



On 7/16/07, Dave LeCompte (really) <dave@xxxxxxxxxxxx> wrote:
"Giuliano Vilela" <giulianoxt@xxxxxxxxx> wrote:

> - Glow: I wanna have a system where, when a bunch of particles are really
> close, they area goes all bright glowing.

The basic idea you want to look into here is a technique called "additive
blending". This paper might give you some ideas as to what's involved:

http://wscg.zcu.cz/WSCG2006/Papers_2006/Short/A73-full.pdf


> - Blur: How can I make a particle like, leave a trail or so? Not a big
> trail, something that makes it look like it's blurring the background.

Are you thinking of a "heat haze" effect, where the background shimmers?
(I've seen car racing games do this to give you the feeling of hot
asphalt.) That's a tricky thing to do, but if you can render to an
offscreen buffer, you can "smudge" pieces of the scene over time to get
that effect.

Alternately, if you just want to defocus the background, take the
offscreen buffer and average the pixel values in the area of interest.

Or, if you just want a smoke trail being left by a projectile, I'd have
the projectile particle periodically emit smoke particles. As the smoke
particles age, they get bigger and more transparent.


-Dave LeCompte