I have now been posting these demoes for about 9 months. According to blog stats, your most popular search terms leading here are ‘Metaballs’ and ‘Pixel Bender’ – so I think it’s about time to combine those two !
To render blobs aka metaballs with Pixel Bender I came up with a slightly different algorithm – to avoid the problems with solving an implicit equation in real time rendering. First a weighted average of the distances to each blob – eight of those – is counted, then the output is rendered as a spherical surface. You will find more information on the comments of the code.
The blobs have diffuse rendering with a specular highlight by a fast Blinn-Phong -algorithm, and abilities to adjust the position of light source, colors for the material, shadow and light. In the demo you can choose from some preset materials – looking like oil, chocolate, blood etc … – on the left on the player. You can use mouse pointer as a torch, and clicking changes the rotations.





Hi Petri,
kinda nice little idea to extend the quasi ’standard metaball-method’. You know I´m always attentive when someone plays along with those metaballic stuff.
I think the whole piece may behave even smarter, if each blob reacts on the current mouse-position ( maybe moves into the mouse direction or the like ).
But it´s still a tasty little snippet at the moment….
Cheers.
-frank
By: Frank Reitberger on December 12, 2008
at 8:32 am
wonderful demo!
this is a really good start point for 3d shaders
thanx for sharing!
By: Piergiorgio Niero on December 12, 2008
at 8:40 am
Hi Petri,
Looking great! Ever tried combining this with refraction or reflection, might give an interesting result
Cheers,
David
By: David on December 12, 2008
at 10:10 am
Thanks for your comments,
Frank: yes could be, so far I had the main focus on the pb-code, swf is ‘just something’ demonstrating it … I hope to have time to do something even crazier with this, so Be careful! He’s got metaballs. He might use them! !
David: I tried this as a filter refracting or distorting the source image – but didn’t want to slow down the performance too much, although there would be so much stuff like bitmap texture, reflection or bump mapping to add.
By: pixelero on December 12, 2008
at 10:30 am
Sexy!!
By: Mr.doob on December 12, 2008
at 11:29 am
SUPER NICE!!!
Hyva Suomi.
Sorry taala Kanadassa ei toimi “A” pisteet.
By: Mikko Haapoja on December 12, 2008
at 3:59 pm
wow realy nice!pixel god^^
By: core on January 10, 2009
at 9:16 pm
[...] snippet. Due to the fact that there are a lot of very good snippets out there (just have a look at Petri´s publications for example), dealing with Metaballs, I decided to add some 3D behaviours to my current release [...]
By: actionscript microcosmos » 3D-Metaballs. on January 12, 2009
at 9:29 am