I've been looking into the Stencil Buffer lately in an attempt to make my first actual 3D effort with a little water demo. Any tips, etc would be appreciated as this is rather new to me. I've read the Red Book somewhat but it's still fuzzy to me how it works. Anyone care to break it down into an easy explanation?

Ultimately I'm going to be putting my generated water into Garland's Quest after I'm done. So you kind of get the idea of what type of effect style I'm going for. More a lake or pond type of water than an ocean type of water.


Here are some resources I'm reading to get my information:

Stencil Buffer overview
a brief 'How to do water'

a glscene demo's way I'm trying to follow using the stencil buffer

a whole shpeal on Perlin noise <- I think this is supposed to be more ocean water than lake or pond type water?
GameDev.net article about how to do it, but the effect is more so for rain or water-drop effects than a tidal water motion

a Very Cool Caustics Generator program that creates those really neat lighting effects on the bottom of a pool or shallow clear waters <-- I've made up textures to use from this as the effect is very nice.
The Volition demo's water here looks great but I'm not sure I want to dig right in there and try to extract and recreate it...

Anyhow comments and sugestions or heck, simple code! would be well appreciated.