Pages

Wednesday, 13 May 2009

Liquid Webcam

I was just playing around with the convolution and displacement map filters in flash and here are few of the effects I managed to create. The first two use the convolution filter to displace pixels and cause the ripple like effects found. The 3rd just takes a pixel and averages it's height with the heights of surrounding pixels. The displacement map filter is then used to transform a webcam stream. In the first two examples the diffraction effect is actually quite realistic although a custom pixel transform would have to be created for factors such as surface angle to be taken into account.

A word of advice, only run one of these at a time because 3 webcam streams with filters can be quite CPU intensive!

So first we have a ripple effect. Click and drag to create ripples on the webcam stream.

Flash 10 demo

Next we have a rain effect. Random pixels are created which are the convoluted and create the effect of rain drops hitting water.

Flash 10 demo

Another mouse drag effect. Clicking the mouse increases the height of the water. This one is quite an interesting effect, not sure its as aesthetically pleasing as the other two though!


Enjoy!

No comments:

Post a Comment