I'd like to know how to do two things with materials related to the Ocean Modifier:
1) Change the color depending on the depth of the water, and
2) Create some believable foam.
Both of these features should change as the ocean modifier plays back.
The attached image shows what I mean pretty well, methinks—you can see how the water changes to a darker blue where the water is a bit deeper, a lighter blue where it's shallower, and blends to a white where the foam should be. I also believe that this image was made with Blender's ocean modifier [EDIT apparently it's not, but the point still remains]. I'd like this to be possible regardless of lighting conditions.
Does anybody know how to create these effects with materials that use the ocean modifier?