Sign in to follow this  
  • entries
    298
  • comments
    1135
  • views
    231209

Still workin', still codin'

Sign in to follow this  
HopeDagger

132 views

Work Continues

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.
Sign in to follow this  


3 Comments


Recommended Comments

I think the easiest way too create that effect with nice rendering speed is as follows:

> 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.

Share this comment


Link to comment
Quote:
Original post by De Cowboy
I think the easiest way too create that effect with nice rendering speed is as follows:

> Clear a buffer to all 0
> Render the balls there, with opacity wanted as value
> Render scene as normal, multiply with the buffer


This sounds like it would still be processing at a pixel-level, which is the inherent cause of the slowness in my current system -- unless I'm misunderstanding. I have a couple of other ideas for speeding things up, but I'm definitely open to more suggestions.

Share this comment


Link to comment
I meant to say 'do it on the graphics card'.

But I don't think your currently using opengl or d3d, so it isn't really useful :)

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now