#### Archived

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

# Top down 2D waves

This topic is 5825 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I am working on a sim game (in almost real time). There is a view that draws islands in an ocean. What I want to do is add some waves or whitecaps to the ocean to give the game some more eye candy. The view is zoomed way out so the waves don''t need to be very detailed. I don''t need anything hard core or super realistic, I''m basically looking for a simple way of simulating some waves in a solid blue ocean. I looked for some tutorials but didn''t find anything relevant. I was thinking of randomly drawing blobs of darker and lighter blue (using a heightmap?) over the ocean before I render the islands.

##### Share on other sites
This sounds like a graphics/rendering/OpenGL/DirectX question, not a physics question...

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

##### Share on other sites
Yes, for our last game we just used movies, i.e. animated textures, for water and waves. Worked pretty well and was far from zoomed out. I would only bother with simulation if your doing a game which takes place in the water, such as a water skiing simulator.

##### Share on other sites
I think you can get cool rippling wave effects using a simple wave equation.

dh/dt = k * laplacian(h)

Where h is the height field, k is just some constant you choose that will depend on gravity, scale, etc.
The laplacian is easy to approximate based on immediate neighbours.

laplacian(x,y) = h(x,y+1) + h(x,y-1) + h(x+1,y) + h(x-1,y) - 4*h(x,y)

"Math is hard" -Barbie

1. 1
Rutin
73
2. 2
3. 3
4. 4
5. 5

• 21
• 10
• 33
• 20
• 9
• ### Forum Statistics

• Total Topics
633426
• Total Posts
3011812
• ### Who's Online (See full list)

There are no registered users currently online

×

## Important Information

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!