Home / Javascript / Light smoke

Light smoke



I tried to put this affect on a video, first i remove the darker part of the video to get the “light map”. Then do the exactly the same thing, the result is quite interesting, move left and right to play. Kind of psychedelic feel 😀


Just trying to redo the smoke effect with js/webgl, i tried once but the result isn’t that good, then i found out that i have to set the blend function to

this.gl.blendFunc(this.gl.ONE, this.gl.ONE);

to get the best result.


Actually it’s quite easy to create this effect, all you need is a background, a light map and a noise. In each frame i just keep apply a displacement effect on the light map, so it gets more and more distorted and in the same time we dim the alpha a little bit in each frame, then you will get the fade out effect and that’s it, really simple, just don’t forget to add the light map again every frame, or the light will fade out very soon.

Leave a Reply

Your email address will not be published. Required fields are marked *