Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

arkansas

water animation

This topic is 5750 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

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??

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

  • 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!