Water

Started by
5 comments, last by Ahvolon 22 years, 9 months ago
Hi, I want to create water with waves and reflections. How can i do this?
Advertisement
Well, what do you think you''d do to create water? You can first think of water a quad, then textured/multitextured with some textures that have moving texture coordinates to make a flowing effect. Then you can think of the water as a large grid that has points that can move up and down creating waves. Go to nehe.gamedev.net and read the flag tutorial there, or look at loderunners ( i think it''s his) water demo thingy and try to do that.
masterghttp:/masterg.andyc.org
Gamasutra, 2 part article on waves and refraction, intersting read.
Ok, check out NeHe''s waving flag tutorial... Water is *A LOT* like that, except that you need some different mathematical formulas to make it look right. Can''t help you much on the refraction end though... But, I think I''ll do some research on it, and write a tut sooner or later (later most likely).

------------------------------
Trent (ShiningKnight)
E-mail me
OpenGL Game Programming Tutorials
Nehe also has reflection tuts (using the stencil buffer if I remember right). I''m not advanced enough to understand it yet, but I have a feeling that the answer that you are looking for is a combination of the flag tutorial and the reflection tutorial.
-Blackstream Will you, won't you, will you, won't you, won't you take my virus?-The Mad HackerBlackstream's Webpage
Reflection is nothing more then Negitive Scaleing about a plane.
(when the plane is infinate)
------------------------------------------------------------I wrote the best video game ever, then I woke up...
You can create planar reflections like that and use the stencil buffer to limit the output to the water. If you have "big" waves will it not look right. Instead can spheremaps (perhaps also dynamic) be used.

The "amplitude" of the reflection is depending on the viewing angle. If you are looking right down at the water should the reflection almost be invisible. This can be achived by setting the alpha values for a spheremap. I think it is called the fresnel part.

Another interesting idea is to combine alpha maps and planar reflections. I have never seen a demo but here is an descripton http://reality.sgi.com/opengl/tips/puddles/

This topic is closed to new replies.

Advertisement