Jump to content
  • Advertisement
Sign in to follow this  
huaihongwu

Metaball rendering optimization

This topic is 2791 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
Oh btw, the resolution of my app is 1024*768, but i guess that doesn't matter, cause I only calculate the "meta-values" for a sub-area of the screen around the particle

Share this post


Link to post
Share on other sites
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!