2 ms·
Just as an aside, there's a much better way of doing metaballs in 2D but that can't be expanded to 3D: http://nullcandy.com/2d-metaballs-in-xna/ http://nullcand
by bicubic 10y ago
Just as an aside, there's a much better way of doing metaballs in 2D but that can't be expanded to 3D: http://nullcandy.com/2d-metaballs-in-xna/ http://nullcandy.com/2d-metaballs-in-xna/
The basic idea is you draw a gaussian falloff sprite for each blob into a render target with additive blending, such that you get a density field from the sum of the falloffs. After that you do a simple threshold operation in the pixel shader and bam, very cheap unlimited metaballs. This is also the principle behind Smoothed Particle Hydrodynamics.