Jump to content
  • Advertisement

Archived

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

helix

Top down 2D waves

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

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 this post


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


Link to post
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

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!