Jump to content
  • Advertisement
Sign in to follow this  
nemesisgeek

OpenGL Modeling water droplets

This topic is 4137 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

I'm trying to model a stream of water as particles (e.g. from a garden sprinkler or Super Soaker). The water is fairly turbulent with a lot of air bubbles - refraction is not likely to be an issue. What I'm trying to do is display the droplets as semitransparent with a blurred background - similar to Vista's glass effects. I'm using OpenGL and GLSL with a custom engine. If possible, I'd like to avoid doing a glReadPixels() call, as that would slow things down a lot. I'm thinking of maybe doing a two-pass render - render once (without the water) into a framebuffer object, make a texture off of that, and then use that texture to do the blurring on the GPU. Does this seem like a reasonable way of doing things? If so, I'm looking for implementation suggestions, and if not, what am I doing wrong?

Share this post


Link to post
Share on other sites
Advertisement
yep, you are in the right way, and this type of rendering can be used to multiple effects in the same scene, like reflections, refractions, HDR...
But instead using Blur, try to use refraction, it has low GPU cost and a more realistic effect, see the watergun in Mario Sunshine for GC.
in my point of view there are 2 Techniques that you can use:
1.: Render the scene without the water into a 'Surface', then render each water drop with a shader using that Surface.
2.: Render the scene without the water into a 'Surface', then render all the water drops into another Surface and use the last one as a refraction map for the first

Share this post


Link to post
Share on other sites
Any ideas on how to do refraction in a shader? I'm not too good at optics - my physics studies so far have concentrated on electronics and mechanics.

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!