Sign in to follow this  
NathanRidley

Shoreline waves?

Recommended Posts

I am nowhere near the level yet where I am thinking about implementing this, but I am still curious. In almost all demos I see from game developers, water along a shoreline is clean and unbroken, simply ending at the point that the terrain rises above water level, which is a very clear contrast to what you see in the real world.

 

Are there any good techniques people are starting to use to create nicer transitions between sea and land? A procedural approach would be of particular interest because it would be universally applicable without having to be hand-crafted. Scenarios would include serene in-and-out lapping of small waves against the beach, right through to violent crashing of waves against rocky shore lines. Slight rising and lowering of the water level near the shore would also be important in order to simulate the waves coming in and out effectively.

 

This is something I'm very interested in implementing in my own development when I'm further along; hopefully next year at this rate. In the mean time, I'm eager to collect examples, tutorials and papers concerning other people's efforts in this area.

 

https://www.youtube.com/watch?v=qREKP9oijWI

 

https://www.youtube.com/watch?v=xvNNTc6ZPtQ

 

https://www.youtube.com/watch?v=6Fgu_itF1gY

Share this post


Link to post
Share on other sites

In my opinion the simulation and rendering of water waves near the shoreline is one of the biggest challenges in real-time water rendering. Afaik no game engines or middlewares on the market support it. Offline renderers are well capable of producing convincing results, as demonstrated by the many animated movies in recent years with water scenes (e.g Surf's Up). Naturally they do not have the tight constraints that games have and can afford the cost of highly sophisticated physical models and continuos artistic refinement.

Games traditionally have employed cheap effects such as foam near the shoreline, modulated by the distance from it, as seen in FarCry, Assassins Creed etc. Outerra uses procedural waves for the shoreline whose parameters (amplitude and phase) depend on the distance to the shoreline. That's a step forward in the right direction.

In general, the proper simulation of shallow waves, characterized by a change of propagation speed, direction and shape profile among other phenomena, would require a complete new technology and a significant investment in R&D that studios can hardly justify.

Myself I have ideas that I intend to prototype at some point in the future. In rough terms, I would calculate local wave solutions near the shoreline, characterized by functions that approximate locally the curvature and distance from the shoreline. For LOD, waves would have a variable granularity based on the distance from a reference point (e.g. the main camera position). For rendering, the local wave solutions would be splatted on offscreen accumulation buffers encoding the final waves displacement, gradients, foam level, variance etc. Physics would be handled entirely on the CPU side.

I'd be happy to go to into more details if there's enough interest, and also share ideas about other approaches.

Share this post


Link to post
Share on other sites

Myself I have ideas that I intend to prototype at some point in the future. In rough terms, I would calculate local wave solutions near the shoreline, characterized by functions that approximate locally the curvature and distance from the shoreline. For LOD, waves would have a variable granularity based on the distance from a reference point (e.g. the main camera position). For rendering, the local wave solutions would be splatted on offscreen accumulation buffers encoding the final waves displacement, gradients, foam level, variance etc. Physics would be handled entirely on the CPU side.

I'd be happy to go to into more details if there's enough interest, and also share ideas about other approaches.

 

Although I'm far from qualified to say anything definitive on the subject, I sort of have an idea that the topic could be approached using interpolation techniques, much like real-time PBR lighting can be calculated at low resolution and then interpolated for a high quality result. My idea is a simple one; basically you'd use a small set of control points, dynamically simulate the movement of those particles around the shape of the shore, whether sandy or rocky, and heavily affected by whether the sea is calm or choppy. By using control points and control splines, mesh deformation adhering to the control data and particles whose movement is dictated by the same, combined with existing techniques for making realistic oceans and water surfaces, I can't help but think there is a decent solution there that would have acceptable performance. Something I'll look into when I'm a bit further along, I guess.

Edited by axefrog

Share this post


Link to post
Share on other sites

Axefrog, your idea is brilliant. It shares similarities with the approach I hinted at in my previous post. Both approaches involve estimating the wave path near the shoreline at control points and then generating the final water surface by splatting a wave shape along the curve defined by the points, warped in amplitude and possibly other features based on the local bathymetry. One design question concerns the organization of control points. Some possibilites are a regular grid, a hierarchical structure or free particles. They all have pros and cons depending on the exact tech requirements. And do not forget physics, that also has big implications on the design choices.
For a prototype of the rendering code, I'd start by simulating waves approaching a circular island, for which the solution is known a priori. I'd then move to the computation of local control points, which in my opinion is by far the most challenging aspect of this technology.

Share this post


Link to post
Share on other sites

Axefrog, your idea is brilliant. It shares similarities with the approach I hinted at in my previous post. Both approaches involve estimating the wave path near the shoreline at control points and then generating the final water surface by splatting a wave shape along the curve defined by the points, warped in amplitude and possibly other features based on the local bathymetry. One design question concerns the organization of control points. Some possibilites are a regular grid, a hierarchical structure or free particles. They all have pros and cons depending on the exact tech requirements. And do not forget physics, that also has big implications on the design choices.
For a prototype of the rendering code, I'd start by simulating waves approaching a circular island, for which the solution is known a priori. I'd then move to the computation of local control points, which in my opinion is by far the most challenging aspect of this technology.

 

Ah, well now I feel validated, thanks :)

 

I will however point out that I'm far from ready to implement this kind of thing; as I said it's more like something I'll be ready to have a crack at maybe next year, as I have a lot of self-education and groundwork to do before then. This is good though, it's all part of my ongoing process to collect as much information as possible in order to refine my general development road map as I move forward. If you end up implementing something along these lines in your Typhoon engine though, I'd love to see what you come up with.

Share this post


Link to post
Share on other sites

Im at the moment going through this as I am doing a WW2 pacific arcade game so water plays a large part.  As you have highlighted, offshore, there are plenty of different effects already established.  But on shore, well, no so much.

I'm nowhere near the sophistication of these examples, but for me, its about passing the glance test (as this is an arcade game and you fly over things quick).  My target is to produce a texture buffer that contains a normal map and an opaqueness value that I will then use to merge into my water simulation around the shoreline.  Hopefully making it look like small waves rolling in.  I've already had one stab at trying to do a shoreline, but its just to sharp.   If i get some progress, I will post it here.

Share this post


Link to post
Share on other sites

I thought I had posted this before, but obviously I had failed to hit "Post".  My initial attempts at coastal waves.

https://www.facebook.com/InsaneSoftware.com.au/photos/pcb.809751212538874/809750019205660/?type=3

- Needs some correction to ensure the inbound waves affect the tessellation of the waves, adding small rises etc.

I have a bunch of other things to add to make this look better, and improve.

Share this post


Link to post
Share on other sites
You have foam where waves are breaking, so that is what you want to simulate.

There exist other papers about this up to 10-15 years old, but I can't find the particular one that I have in mind (which was very good) right now...

This one however seems to describe the principle, too:
http://matthias-mueller-fischer.ch/publications/breakingWaves.pdf

The images in the paper are a bit coarse, you'd probably need 5-10 times as many particles, and have them textured in a way so there's a bit of a smooth falloff to make them look less artificial and to "multiply" them. Plus, texture the breaking wave body with a "foamy" texture on top. But in principle, that's it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this