# simulating water( basic question)

This topic is 3011 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 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 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 on other sites
I found a good article here:
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

1. 1
2. 2
Rutin
24
3. 3
4. 4
JoeJ
16
5. 5

• 14
• 29
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631775
• Total Posts
3002275
×