Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to know the math behind the light effect in krakatoa (click here for an example).

Light source is traveling with particles, but how is shading done? Is it something simple, like Phong shading? Is it possible to implement such effect in real time on GPU?

share|improve this question
Watched about 4 of the demo videos and honestly I do not think they are actually doing lighting on themselves but instead give off light based upon their density and velocity. The video you linked to for example, the emitters are emitting light as well, but the trails do not seem to emit light. In some of the other demos when the trails are again accelerated they 'light up' again. Not sure if this helps but maybe just some insight on how that could be achieved. – James Sep 21 '11 at 0:10
The effect itself is most likely possible on the GPU in real time. The problematic part would be the number of particles. – Samaursa Sep 21 '11 at 1:09

It looks like self shadowing particles to me; basically you have 3 point lights that move about the scene with a smoke/particle trail. The hard part with getting that look right is that the particles are translucent so you can't really do hard shadows, Volumetric Particle Shadows might be a good start for implementing a similar effect. Hope it helps.

share|improve this answer
I agree, I've done a similar effect with a point light moving with the front of a particle swarm – brandon Mar 23 '12 at 15:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.