• Advertisement
Sign in to follow this  

2d Image distortion effect

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

Have you ever seen a drop over an image ? I want to make that. Assume that you have a perfect circle-like drop of water , its radius R and its center , and a 2d image. I want to compute a new 2d image or buffer with the distortion effect of the drop over it. Do you have any Idea how? thanks

Share this post


Link to post
Share on other sites
Advertisement
Most games use (afaik) a distortion map for their distortion/perturbation effects (such as heat distortion). It's simply a map containing an offset vector for each pixel - typically encoded in the red and green color channels. The distortion is done in a postprocess pixel shader. Each pixel is shifted by the corresponding offset - of course you can do it in software, too.

The main problem is how to get a realistic water drop. It think a water drop is a flat sphere (and you're looking down at it). If a ray enters the drop, refraction occurs, depending on the refraction index of water (constant) and the input angle. You could follow this ray until it intersects the base plane. Then cou can simply take this as the offset vector for the intersection point.

Don't know whether this works. I hope it does. Well, it is at least a good approach to start with.

--- Alex

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement