Graphics Reference
In-Depth Information
The Fog_underwater node group pasted at the end of the shader
How it works...
First of all, why should we choose a Cube for the ocean surface instead of the simpler Plane?
The reason is very simple: in Cycles, the World emits light, and the only way to avoid this is to
set the color to pitch black (or by a combination of a Light Path node with the World materials,
but this is another story). In our scene, the World is set to a bright blue sky color, and with a
Plane, the underwater objects and the ocean bed would have been lit too much from the sides
and the bottom the result look natural. A Cube, on the other hand, envelops all the underwater
elements, limiting the lighting to the Sun Lamp passing through the surface, and projecting the
image textured caustics. This gives a more natural-looking result.
The image texture we assigned to the water material is used to obtain a textured transparency
effect. Right now, the water surface is actually opaque and transparent according to the black
and white values of the textures, so as to allow the Sun Lamp light to pass through and project
the caustics.
Thanks to the Is Camera Ray output of the Light Path node, the caustics image texture is not
directly renderable on the ocean surface, but it nevertheless has some effect on the other
materials. Because the value of Is Camera Ray is 1 , the rays starting from the Camera and
directly hitting the ocean surface can render only the clean water material plugged into the
second input socket of the Mix Shader node, while the transmitted caustics (plugged in the
first Shader socket = 0) get rendered.
 
Search WWH ::




Custom Search