In this lesson you will learn how to create ripples on water that appear to cross over and float through each other.

This will be done by using multiple water textures that will be layered to provide information to a bump node to produce the ripples. You will map the textures to the colorOffset attribute to layer the ripples onto the surface of the water.

This article is an update for Maya of a previous article "Texture Mapping Aoffsets" by Erik Noteboom; Alias Assistant, Issue #14.



Open the Hypershade window and Create a Blinn material node.

Open the Attribute editor window for the Blinn.

Set the Color to Light Blue.
Map a Water texture to Bump Mapping.
Rename this texture to Ripple.



Create a NURBS Plane. Scale it out so that it covers the grid in your perspective window.

Add and Position a Directional light so that it is illuminating the plane.

Assign the Blinn to the Plane.



In the Attribute Editor for the Ripple set the following:

Wave Amplitude to 0.0
Ripple Amplitude to 4.0
Spread Rate to 0.5
This will be your main water texture that will have other water textures mapped into the Color Offset attribute.



To animate the ripples, you will need to keyframe the Ripple Time attribute.

Make sure your Timeslider is at 1. In the Attribute editor for your Ripple texture, set the Ripple Time to 0 and using the RMB set a key for it. Move your Time Slider to 40 and key the Ripple Time at 1.



You will now duplicate the Ripple texture with the animation.

With the Ripple node in the Hypershade selected, go to Edit > Duplicate > Shading Network. Rename this texture node Ripple1. This will create a new water node without any connections to the shading network.



In the Attribute editor for Ripple1, change the Ripple Origin to 0.2 and 0.3. Finally with your MMB, drag the Ripple1 onto Ripple, and connect to Color Offset from the pop-up menu. Notice the updated water texture in the Hypershade.

At this point you will notice that the original water texture becomes white. This is because the color offset channel is used to add color. By mapping a texture to it you are actually adding more color to it thus resulting in a white. This will still work with this example because the information for the bump is there even though you cannot see it.

NOTE: To see the changes you are making in the Hypershade on the original water texture, you can remap the colors of the original water texture with a ramp.



Repeat the above steps to produce two more water textures. Rename these Ripple2 and Ripple3.

Connect Ripple2 to Ripple1's colorOffset.

Connect Ripple3 to Ripple2's colorOffset.

For the Ripple2 change the Ripple Origin to 0.4 and 0.4.

For the Ripple3 texture change the Ripple Origin to 0.3 and 0.5.



In the Hypershade window, select the Ripple3 texture. Select Window > Animation Editors > Graph Editor.

Press W on the keyboard to select the Move tool. Click on the curve to select it. Hold down the Shift key, Move the curve to the right so that the end Keyframe is set to around 70.

Repeat for the Ripple2 and Ripple1, setting their end keys at 60 and 55 respectively.



Render the Scene.

You will notice in your render that only the Ripple node is rendered while the others do not render out. The reason for this is that the Bump node uses Alpha information which is not provided because you have only been mapping color information from the previous nodes. You will need to use color information to provide the bump information.

To do this, Create a Luminance Node in the Hypershade under the Utilities menu.

Highlight the connection between Ripple and the Bump Node and press Delete.

Drag Ripple onto the Luminance node, the connection editor will open. Connect Ripple.outColor to Luminance.value.

Drag Luminance on to the Bump Node, to Connect the Luminance.outValue to Bump.bumpValue.



Test Render your scene at a few different frames. You should now see ripples on the surface. You can also increase the Ripple Amplitude attribute to create ripples.

Mapping textures to the colorOffset of a texture offers a way to layer textures that will ultimately be used as a bump map. Keep in mind that you will need to use a luminance node to achieve this result.

Another approach to this is instead of connecting Outcolor to colorOffset, connect outAlpha to the Alpha Offset for each texture thus keeping Alpha information intact which can connect directly to the Bump Node therefore eliminating the need for the Luminance node.