3D tiling

I have a water tile (a heightfield), that I can render ok, but don’t know how to tile it. I was thinking of forcing the two pairs of edges of the tile to have the same height values, like this:

``````
aaaa
b  b
b  b
aaaa

``````

But the results are not convincing. Can you please share some insights?

Behold ye moving mountains (erm… waves):

pic

Maybe I should attenuate the wave tiles at the edges? I could also flip odd tiles, but flopping odd tiles will make waves move the wrong way. Please help.

To be tileable, your pattern must have wave length which is an integer multiple of the pattern length, and for each direction.

How do you build your wave tile ?

Using the gerstner algorithm. If I do as you say the only 2 directions I will be able to use will be horizontal and vertical.

This one looks better doesn’t it? I did it by specifying:

h(0, z) = h(1, z) and
h(x, 0) = h(x, 1)

and fixing the wave parameters to comply.

Maybe you can discern some artifacts in the snapshot, something that I did wrong?

The only thing remaining now for me is to figure out how to do bump mapping, reflections and I’ll probably have what is called environmental bump mapping. I’ve noticed that many programs attenuate what they reflect. Do they simply multiply the reflected colors with a coefficient < 1? I’ll probably have to model the sun using a directed light no? Do I use Phong shading for water? I’ll be grateful for every hint you may have for me.