2 Comments

Water waves

Using scrolling normal maps for water gives us a nice look for tranquil lakes and such. In order to get something that looks like it’s actually interacting with the environment though, we need to actually modify the water geometry.

Sine waves are one option: basically we’d displace the height of the water vertices based upon sine wave. A better option are Gerstner waves . They improve upon simple sine waves in that a vertices xy position is also changed, which more accurately models how real water waves look (see the linked article above for a better explanation).

 

Gerstner waves in my engine.

Gerstner waves in my engine.

 

Gerstner waves are what I currently use in the water shader in my engine. I layer four of them on top of each other to create sufficient variety. At any one point, one of them is fading to zero amplitude in order to be replaced by a new random wave.

I don’t yet have them tied to the wind in my world, but the plan is to roughly align them with the current wind.

 

Wire-frame of Gerstner waves.

Wire-frame of Gerstner waves.

 

One advantage of using a strict calculated wave like this is that I can duplicate these calculations on the CPU in order to, for example, place an object in water and have it bob up and down.

Ideally I would have a water simulation that allows for real interaction with the environment: “bouncing” off cliffs and speeding up over shallow water. I haven’t yet looked very far into doing this, but I would imagine I would still use the Gerstner waves as “energy input” to the water simulation (i.e., the wind action).

Advertisements

2 comments on “Water waves

  1. Have you considered Trochoid waves? The best water render I’ve seen is based on those. ( http://youtu.be/Fc0uFQO2BlU ) (I would kill for an XNA implementation! :>)

    • It looks like trochoid just refers to the shape of the waves. The Gerstner wave algorithm emulates that shape (in fact, that is the principle difference between plain sine waves and Gerstner waves). That video super-imposes vastly different wavelengths of waves, which is why I think it looks more realistic.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Space Quest Historian

Let's Play's, Podcasts, and General Adventure Game Goodness

Harebrained Schemes

Developer's blog for IceFall Games

kosmonaut games

Development blog of "Bounty Road"

Halogenica

Turn up the rez!

bitsquid: development blog

Developer's blog for IceFall Games

Game Development by Sean

Developer's blog for IceFall Games

Lost Garden

Developer's blog for IceFall Games

Memories

Developer's blog for IceFall Games

Casey's Blog

Developer's blog for IceFall Games

Blog

Developer's blog for IceFall Games

Rendering Evolution

Developer's blog for IceFall Games

Simon schreibt.

Developer's blog for IceFall Games

Dev & Techno-phage

Do Computers Dream of Electric Developper?

- Woolfe -

Developer's blog for IceFall Games

Ferrara Fabio

Game & Application Developer, 3D Animator, Composer.

Clone of Duty: Stonehenge

First Person Shooter coming soon to the XBOX 360

Low Tide Productions

Games and other artsy stuff...

BadCorporateLogo

Just another WordPress.com site

Sipty's Writing

Take a look inside the mind of a game developer.

Jonas Kyratzes

Writer, game designer, filmmaker.

%d bloggers like this: