With the first week of my co-op job completed, the weekend certainly felt nice. I feel refreshed enough to endure another five days, and made plenty of gamedev progress during the weekend.
Metaballs!
I've been really interested in this effect for quite some time. It's been scattered about in demos and CGs here and there, but I never really took the time to sit down and read about how it works.
The idea behind metaballs is to have an imaginary 'electrical field' around each ball, which is basically "1 / distance-to-metaball-centre", which you sum up for each pixel on the screen. Every pixel whose sum passes an arbitrary threshold receives the privilege of being rendered.
My first attempt isn't efficient at all (almost purely brute force), but with the ideas I now have I've got some future optimizations planned. This would have made a neat effect in Membrane Massacre, but it has plenty of other cool applications, like blood/water droplet particles that merge together with others as a visual effect.
Kudos to Ryan Geiss' article, which was of great help.
Download Metaballs Demo
(Metalicious!)
Other Adventures
I've also been working on a few other educational experiments behind the scenes lately, such as software-based 3D rasterization and rigid body dynamics. Although I have nearly demo-worthy material to show, I'd like to learn more before I try to talk about the topics around here with any sort of semblance of authority. [grin]
Lastly -- and not leastly -- I've been working hard on my game development project for the summer. It's not Skirmish, but it's very promising. I've decided to first develop a flexible library on top of OpenGL+SDL beforehand, since it feels like I've written the basis code for it a million times. I might as well wrap it up for future use in upcoming games. Talking about engine internals isn't very exciting stuff for a journal, so I'll leave it at that, and start posting screenshots as soon as things develop further.
> Clear a buffer to all 0
> Render the balls there, with opacity wanted as value
> Render scene as normal, multiply with the buffer
You could use a texture, or maybe the stencil buffer; it would be pretty fast and portable to older systems, I guess.
Edit:
Oh, you would need a threshold too, but, if you can't do that with stencil buffers, would be easily done with a shader.