Let's try something more complicated. Suppose you need a shader that gives you a grayscale image based on the relative height of the parts of an object... like a topographic map, where high points are white and low points are black. A shader like this could be useful in post-production for exaggerating the shadows between ripples in a pond, for example. To create this effect, we can use samplerInfo again.
First, make a shape with some obvious height differences... I made a rippled surface like the one pictured. Create a surface shader, a ramp texture, and a samplerInfo node. Then create two locators in your scene, one named highLoc and the other lowLoc. Position highLoc on the highest peak of the surface, and lowLoc on the lowest valley. Finally, create the new node for this example: the setRange node, another utility node found in the same menu as samplerInfo. This node lets you take a range of values and crunch it into a different range. In this case, we'll take the translateY values of these locators and scale them down to a range between 0 and 1 to work with the ramp.



