Jump to content
  • Advertisement
Sign in to follow this  
Structural

OpenGL Distortion effects

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

How would I make a distortion effect with OpenGL? For example, when looking through water whatever is below it is distorted in a way, not clearly visible. I'm asking this for a cloaking effect of players, who would distort their background a bit if they are cloaked and a weapons effect.

Share this post


Link to post
Share on other sites
Advertisement
although i have no experience with this, if i were going to experiment, i would try techniques involving rendering to a texture, and using that texture on the cloaked object

hmmmm.... now this has me really wondering.

Share this post


Link to post
Share on other sites
Quote:
when looking through water whatever is below it is distorted in a way, not clearly visible.


This is known as refraction which is where light rays bend when moving between the interface between two different mediums (i.e. when they enter water from the air). A common way of implementing it is to render the scene under the water to a texture. Then when rendering the final scene you projectively texture a grid representing the water with this texture distorting the texture coordinates depening on the normal at the point where the texture is applied. This can give a refraction effect. This article may be of interest to you, although it talks about reflection the technique is similar for refraction (google should give you some more info).

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!