Test/Tutorial: Realistic tropical water shader in Cycles!

Since this didn't get accepted as a tutorial, I decided to post it here

Ever wondered how to make a beautiful, turqouise and realistic water material in Cycles? Well it here it is!

Tutorial: http://imgur.com/a/4nSuO

If you are lazy, you can just download the .blend file: http://www.blendswap.com/blends/view/71325
The result:


The water gets darker, as it gets deeper.


On deep water it looks just as realistic.


Pros:
-Is realistic
-Is render-effecient
-Is easy to make

Cons:
-Does not work underwater
-Is not animated (can be done though)
-Requires the seabed to be textured in a specific way (see tutorial), so the shader won’t work right off the bat.

Why wasn’t this accepted as a tutorial? This is really cool, man. I was looking into how to do this effect for my own stuff.

I had done a similar method for a previous project, where i think i used an empty object as a UV projector for a shading ramp for any objects that dip below the water line. using the projector allows objects to animate in and out of the water, and you can use the same projector for consistent shading with multiple objects (ground, boats, etc).

another good solution i recently found was a light path/ray-length node setup, which checks if an object is being viewed through the water (“is transmission ray”), and then applies a shading ramp according to the ray length. this is the most flexible since it doesn’t require a flat water surface, and also shades more realistically since its view dependant, and not just a vertical depth calculation.


I have been experimenting with this way of doing it but i can’t seem to fiqure out how to do it. This is what i get:


It is using the ray length from the camera, and because of that it just becomes white as you zoom away from it. I’m not sure how to use the “is transmission ray” to check if it underwater. Please explain :slight_smile:

Not at a blender computer right now, I’ll share a blend later, but the trick I discovered was that the shading has to happen on the objects in the water, not the water itself. It’s a little tedious, but you can make a node group out of it and apply it to numerous objects. The basic setup is to take the diffuse colour of the object, and multiply it by a ramp controlled by Ray length (like you’ve done), but to only use transmissive rays (basically multiply ‘is transmission ray’ and ‘ray length’)

Thank you so much man! It works like a charm! Now I will focus on getting the caustics and the waves animated, and maybe make a version 2.0! xD