Here's a presentation from one of the mercury guys explaining how to do that kind of thing: https://www.youtube.com/watch?v=s8nFqwOho-s
Also, elevated from RGBA should probably be mentioned since iq (https://www.shadertoy.com/user/iq) is the guy behind Shadertoy. (Also because it's pretty.) http://www.pouet.net/prod.php?which=52938