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?

  • 3
    \$\begingroup\$ 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. \$\endgroup\$
    – James
    Sep 21, 2011 at 0:10
  • 2
    \$\begingroup\$ The effect itself is most likely possible on the GPU in real time. The problematic part would be the number of particles. \$\endgroup\$
    – Samaursa
    Sep 21, 2011 at 1:09

1 Answer 1


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.

  • \$\begingroup\$ I agree, I've done a similar effect with a point light moving with the front of a particle swarm \$\endgroup\$
    – brandon
    Mar 23, 2012 at 15:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .