Jump to content
  • Advertisement
Sign in to follow this  
ehsan2004

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.

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


Link to post
Share on other sites
Advertisement
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
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
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!