Skip to main content
GameDev.net gamedev.net
🔒 Locked

Water effect

Started by popeye Oct 1, 2000 at 6:02 AM 7 replies 500+ views
Original Post
popeye
popeye
Hi Does anyone know where there are any tutorials on generating water effect un gl. have tried searching the forum with no luck thanks in advance
Ozz
Ozz
Jeff Lander at www.darwin3d.com did a great 2d version using opengl, the binary/source is on the site but its difficult to find, its in a section listing all the stuff he did for GDmag last year. Id look for it now but Im in college. I`m very interested in 2D/3D water efects, as a matter of interest why what are you doing with it and I may be able to help.
popeye
popeye
Thanks for the info.

I am at Uni myself. Doing a games programming course.

Have been developing some ideas over the summer and need a water effect for my portfolio.

Popeye
Ozz
Ozz
http://www.darwin3d.com/vsearch/FluidSim.txt
http://www.darwin3d.com/gdm1999.htm#gdm1299

This guy did a 3D version of Jeffs` 2D effect:
http://www.codercorner.com/Pierre.htm

Picture:
http://www.flipcode.com/cgi-bin/msg.cgi?showThread=09-17-2000&forum=iotd&id=-1
Cel
Cel
I wonder how a system with the flag effect made to look like water, with environment mapping applied and taken to ~50% alpha would look......


hmmm I gotta make some water too, tryin to get the fastest and coolest lookin way

Cel
Cel aka Razehttp://chopper2k.qgl.org
Korihor
Korihor
Hmm. You may want to try a triangle mesh with a ''wave'' effect placed on the axis to make the triangles move up and down. You should be able to derive the way to move the vertexes up and down from the code used for the texture. (ie: if it''s lighter move the vertex up, or whatever). As a matter of fact, I think that''s what I''ll try next.... =)
OGAPO
OGAPO
If you want to make it really look real remember the physics of water waves. As far as programming goes the previous poster probably had the best idea with the triangle mesh with a wave deform. You might try bezier curves with aa 2ndary deform to add extra realism. Here are some properties to keep in mind.

Water waves are usually composed of large, faster waves, with small, slower moving waves superimposed on those. (this gives the effect of the larger waves sliding under the small ones).

Deep water waves move faster than shallow i''m pretty sure, that''s why waves crest when they get near the beach.

If you want to use Beziers, you might save time (i''d have to do the calculations to be sure) if you first applied a wave transformation to the control grid, tesselate, then add the smaller wave transformation. With the beziers, you''d be able to calculate exact reflection/refraction maps too if you''re interested in being that realistic. If time is a big factor, go ahead and use the triangle mesh though.

hope this helps,
David Nikdel (O.G.A.P.O.)


/* If at firse you don''t succede, skydiving is not for you. */
Brought to you by: [email=ogapo@ithink.net]O.G.A.P.O.[/email] +----------------------------------------+| Surgeon General's Warning - || OGAPO can cause serious mental damage || if taken in large doses. |+----------------------------------------+/* Never underestimate the power of stupid people in large groups */
Strylinys
Strylinys
You could also take into account the cross wind on top of the wave current so that you get waves that cross at certain angles and really nice ripple effects and things... you could do the same kind of thing for boats in the water... etc etc. Just remember, when you''re adding these waves, you do add the total height and not just average it.

S.
NeHe
NeHe
Converted the flag effect into a water demo. It''s a little rough around the edges, but it took just 20 minutes to code. With a little creativity, you could alter the map intelligently and create rolling waves, along with a few hundred other cool effects!

Just playing around

TTYAL


Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.