# simulating water( basic question)

This topic is 2795 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 I'm really confused why I can't find a good article about simulating the water ( with refraction and reflection ) using GLSL? I have read an article about it here: Realistic Water Using Bump Mapping and Refraction But the source code is not available and I don't want to buy a full CD to just see one source code! Are there any examples to use this method to simulate water? Thanks Ehsan [Edited by - ehsan2004 on April 23, 2010 10:30:56 AM]

#### Share this post

##### Share on other sites
Here's a nice looking article:

Chapter 1. Effective Water Simulation from Physical Models

EDIT: Normally for complex tasks such as these you're not just going to find a full source code dump in a free tutorial. There should be everything you need there to implement this if you want, but you have to do a little thinking on your own.

#### Share this post

##### Share on other sites
Thanks, but it also simulate the waves using the formulas. I need a simpler approach and just need to use a normal map and a du/dv map to simulate the water effect.
I don't need to deal with the actual waves.
It seems that some powerful engines such as Unreal have also used from this manner, because when I move the camera near the water, I just see a flat surface and don't see any actual waves.

[Edited by - ehsan2004 on April 23, 2010 11:14:46 AM]

#### Share this post

##### Share on other sites
I found a good article here:
http://www.docstoc.com/docs/21048644/CM0304-Graphics-Overview-Vertex-and-Fragment-Shader/
Here's the algorithm:
Draw a quad as water surface rendered in three stages
1)Render reflection and store it as texture
2)Render refraction and store it as texture
3)Render scene with water shader turned on for water
surface
– Use a normal map for bump mapping (in tagent
space)
– Use a dudv map (derivative of normal map) for
refraction and how light will react and bend on the
object (in tengent space)
(blur normal map for generation and blur dudv map again to get
rid of sharp features)
– Use reflection and refraction texture on water surface

#### Share this post

##### Share on other sites

This topic is 2795 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.

## 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