Sign in to follow this  
ehsan2004

simulating water( basic question)

Recommended Posts

ehsan2004    178
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


Link to post
Share on other sites
ehsan2004    178
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


Link to post
Share on other sites
ehsan2004    178
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


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