Sign in to follow this  

Metaball rendering optimization

Recommended Posts

huaihongwu    122
Hi there, I did a metaball rendering app yesterday, and the result was pretty good, but there is one thing that can't be figured out. The rendering speed is very slow, I wonder someone can give me some ideas or references about 2D metaball optimization.
What I am doing now is to simulate fluid with hundreds of particles, but since the rendering is inefficient(about 30fps with 5 metaballs...), I can't do other computations anymore.
I did use some kind of optimization, I splited the screen into uniform grid, and made each metaball only affect a subregion of the screen. But the speed was still slow.
I used glDrawPixels in the app, is glDrawPixels a slow function??? I think it is based on my own experience.
Are there some ways we can avoid using glDrawPixels in per pixel computation like metaball???
thank you.

Share this post

Link to post
Share on other sites
dmatter    4821
I'm no metaballs expert so my suggestions are somewhat high-level. I suggest either shifting the computation into a fragment shader or, if you want to keep it CPU based, you could look at using a 2D voxel grid and the 2D version of marching-cubes to reconstruct the implicit surface.

Share this post

Link to post
Share on other sites

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

Sign in to follow this