Sign in to follow this  

Beach waves/foam

This topic is 4273 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 know this has been discussed before, but i cant find a good general solution for generating beach waves/foam, such effects can be seen in FarCry and other games. In my D3D engine's landscape renderer, i have of course a terrain and a water plane. The terrain is a just a giant mesh, and the water level is always at the same height position. Currently my method is like this: I go through each vertex of my terrain mesh and find any vertex close to the water level, then create a sprites there(actually its preprocessed into an array and the sprites are dynamically placed and removed for speed), with the rotation facing the normal of the vetex.. this works reasonably well in many cases.. but since sprites are sprites, they cant conform to the beach very well, and can look out of place or cutting into the beach area etc. Another idea i have seen is to take the terrain mesh and cut out all the polygons at a certain level, align the vetices to the same y position, and remap the texture coords. This could work well if you have a grid-based terrain mesh, but currently I'm using a more organic mesh, with some large and some small triangles. Anyway.. anyone have any ideas on this?

Share this post


Link to post
Share on other sites
My first thought is that you could slice the landscape where it meets the water, making a number of edges at water level. Then you could extrude these edges away from their original faces, creating a band around the land, on which you can put a moving wave texture - or some other method you can think of.

Share this post


Link to post
Share on other sites
This could be done in a modeller yes, but what about doing this automatically so you dont need to manually create the wave model everytime by hand? Could you slice geometry like this in D3D?

Anyone know how its done in farcry?

Share this post


Link to post
Share on other sites
If you open a map in the sandbox you can see that they place strips of vertices right along the beach. It definately looks like it's procedurally done (no long artist tweaking) although how they generate the mesh I don't know. I would also be very interested in a good technique.

Share this post


Link to post
Share on other sites
Sign in to follow this