DrMCClark opened this issue on Mar 30, 2006 ยท 79 posts
bagginsbill posted Fri, 31 March 2006 at 9:44 AM
In the upper right is the fBm and math function to generate the foam structure. This is passed through a math function only so I can easily turn it off without disconnecting it. I just set the math value to 0. The fBm produces white where I want foam. This is fed to the diffuse_value, so where there is no foam, the square produces no diffuse light.
To the left of the fBm is a math function which "inverts" the foam map. This becomes my clear water map. In other words, where the water is clear, this is white. Where the foam is, this is black. I feed this to the specular value, because I don't want specular reflections on the foam - just the water. I also feed this to the reflection and refraction values. Again, I only want those effects on the water, not the foam.
The reflect node is straightforward. You can adjust the value (.2) up or down to suit your taste. Don't make it too high or the water won't look real.
I've done a coupld tricks on the refract node. First, I set the softness to .5 - this makes the water a little murky. You can set it to 0 for crystal clear water. But surf always has some sand and bubbles in it and this takes care of it. Second, I set the RayBias to 1 inch. This means that any object within an inch of the surface will not be "seen" by the refraction. Or something like that. Anyway, it is this value that makes the edge of the water look white where it comes in close contact with the sand. I set the Refract background color to white and this makes the nice foamy edge on the water. Pretty cool, huh? Its actually a bug that I turned into a feature.
The v texture coordinate of the square drives the blender which chooses what color to tint the water. I used aqua and very light gray. Play with other colors here. Please realize, this is a trick and I have carefully contrived my scene to let this work. If the camera was seeing a curve around the water, it won't look right. I think of ways to deal with that, but for now, just make the sand-water interface roughly aligned with the X axis and all will be copacetic.
Finally, the Displacement is a combination of a Fractal_Sum and the Foam. You can try other functions instead of Fractal_Sum, like Turbulence, Waves, Spots, etc. Lots of different effects are possible.
To get good specular glints off the water, you need to either have some pretty violent displacement or, as I have done in my picture, put the sun back enough so it shines somewhat towards the camera.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)