Sign in to follow this  
zurekx

Refractions

Recommended Posts

I'm working on an landscape engine, and Im about to add water. I just wonder, is it possible to get "perfect" refractions (assuming that the water is just a single plane)? For reflections it's easy, but is there any way for the refractions?

Share this post


Link to post
Share on other sites
Perfect is a rather subjective word. You can certainly get nice looking refractions. The usual way of rendering the refraction is very similar to reflection. You render your scene to a texture, project this onto the water plane and then disturb it along the water normal (can come from a normal map) with the projected texture coordinates.

Share this post


Link to post
Share on other sites
solution that Matt Aufderheide and glaeken described is very good looking and used almost always today.
Although it's not physically correct (I'd rather say physically than optically ... because it's not just the refraction, which makes water look nice ... but more things - caustics, scattering, etc. etc.) ... if you want something physically correct, you'd need to use ray tracing.
But there are several solutions how to use rasterizers, cube mapping and some calculations with index of refraction to get almost correct refraction without ray tracing.
You just use cube map around the water, calculate refraction direction from eye direction and use this vector as lookup into this cube map texture ... then you'll have much more correct refraction

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