Advertisement

water animation

Started by January 22, 2003 11:11 AM
5 comments, last by arkansas 22 years, 1 month ago
hey I want to animate water and I want it to move like a sinus curve. So I thought of puting height coordinates of a complete sinus curve into an array and then I just repeat assigning the height values to the water quad y value. Is that a good idea or is there a better way??
What is a *good* idea or a *better* way ? Do mean performance ? realism ? memory usage ? difficulty to code ?

Actually I know two main approaches for realtime rendering :
- if the water is "far", render a flat plane with a good translucent texture (and a good shader if possible),
- if the water is "very close", render a complex geometry built by octaves with different frequency and amplitude (each being inverse proportional to the other).
Advertisement
well...
all I care about is the realism :D
the camera will move real close over the water. So I need a good way to get realism.

would my way work?
This would work but it''s like you''re using the octaves technique with only 1 octave, so it will look very fake.

The octave technique is the following :
- each octave is described just like your sine wave technique : the mesh is a heightmap where height is dependant to a sine-like function,
- octaves may have different amplitudes, frequencies and speeds,
- the final mesh consists in adding all octaves; by "adding" I really mean the "+" operation,
- animating the mesh consists in translating each octave with a constant speed over itself but speed different to another octave''s speed, and then build the final mesh again by adding all octaves.

For more information about the technique you could search gamedev articles. I''m pretty sure it is described womewhere in the ''water effects'' section
ok.. thanks a lot. I will search gamedev.
hey

I got it now.. i didn''t find no article about water animation..
but I know now how it works. I don''t need no array. *smile*

thanks anyways...
Advertisement
please keep in mind that it''s pretty computer-intensive. If "all you care about is the realism" than it''s probably not a problem. Otherwise you may want to optimize it via sine tables or vertex programs etc.

Good luck for the implementation

This topic is closed to new replies.

Advertisement