Water suggestion/question

I notice that in a lot of games water is simulated with moving (square) textures. They use transparency with a water texture. I can handle the transparency and the texture, but I’m not sure of a way to simulate the movement and not have the square texture protrude from what it’s moving in.

For instance, if the following is a birds eyes view of square swimming pool how can I animate my textures moving whithin the boundaries of the pool? Thanks so much.

| |

Clamp your textures to each square
then when you move/animate your vertex points your texture coords will not need to be modified.

I’d suggest moving the vertices up and down, for example on several overlapping sine waves and additionally moving the texture coordinates in some way that has the same period as the water waves.
Might also look good to have 2 different textures on the water surface, alpha blended and moving in different directions. That would give it a more heterogenous look and get rid of visible tiling.

Thanks for the suggestions…I’ll try them out