Beach waves/foam

Started by
2 comments, last by jamesw 17 years, 11 months ago
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?
Advertisement
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.
--Jeroen Stout - WebsiteCreator of-Divided
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?
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.

This topic is closed to new replies.

Advertisement