4 ms·
You could get something visually similar by animating sprites with blurry edges, and thresholding the composite image. I can’t imagine that would be too expensi
by tobr 6y ago
You could get something visually similar by animating sprites with blurry edges, and thresholding the composite image. I can’t imagine that would be too expensive to do at high resolution in JavaScript.
- jmiskovic 6y agoDepending on blur function the result could be identical. Rendering blurred balls means brute-force calculation of contribution of each metaball for each rendered pixel. The larger your blurred image, the higher your fill rate will be. This would choke the performance for large number of balls. You also end up with sampled (pixelized) output which doesn't give you normals and similar geometry information.
- rezmason 6y agoIf your metaballs are mostly the same size, the blurring step can happen ahead of time with a commutative convolution, stored in the texture. Then, rather than applying a threshold to the resulting pixel/voxel contribution, you can apply a sigmoid function (or something cheaper approximating it) and get smooth edges. You can cheat normals like you can with any other sort of height map, by measuring the differences between neighboring fragments. like so: https://rezmason.net/scourge/quick_metaballs.mp4 https://rezmason.net/scourge/quick_metaballs.mp4
- pixelpoet 6y ago80s/90s demoscene had a lot of exactly this :) And of course the 3d blobs via marching cubes.