MATHS: STEP

MATHS: STEP FUNCTION

The Step function asks a simple question. Is Value_2 equal to or higher than Value_1? If it is, then the output is white (1). If it is not, then the output is black (0).

The step function is one of many that can be used to create a black and white mask from a picture. The fact that it will only ever produce zero or one gives it a great advantage over many of the others functions used.


Fig 1: Step used to mask bright areas

Figure 1 shows how the step function can be used to create a mask that picks out the bright elements of another node. Plug the node you want to mask into Value_2. Set Value_2 to 1. Value_1 controls how bright the input node has to be before it shows up as white. The higher you set Value_1, the brighter something will need to be in the input node for it to appear as white (1). Here we have used 0.5 for Value_1. As a result, any part of the Clouds node that is more than 50% gray shows up as white (1).


Fig 2: Step used to mask dark areas

If you want to pick out the dark areas of your node, then swap Value_1 and Value_2. Plug the input node into Value_1, and adjust Value_2 to control how dark something has to be before it will show up as white (1) in the result. This time Value_2 controls how dark something has to be to show up as white in the mask. The lower we set Value_2, the darker something will need to be to appear in the final mask. The higher we set it, the brighter something can be and still appear in the result.

Remember, white will be produced when Value_2 is larger than Value_1, so the higher we set Value_2, the more of the final result will be white. With low values of Value_2 only very dark parts of the input node will produce white (or 1).


Fig 3: Step used with two inputs

Step can also be used to compare two different nodes. Here we are comparing a U node and a clouds node. Our U node increases in value from 0 at the left to 1 at the right. On the left, the cloud node is always brighter than the U node, and so white is produced. On the left, the U node is always brighter, and so black is produced. In the middle we get an rather interesting effect as the value of U gradually increases.


Fig 4: Step used with one colour node

Finally, we can plug a coloured node into the step function. Poser will take the three colour channels and average them out to produce a numerical value.

So, why are the three stripes different lengths? Our U node is producing a number that rises from 0 to 1 as we move left to right across the node. The longest white stripes are produced by the blue. This is a primary colour (Red=0, Green=0, Blue=1). Poser averages this out as 0.33. The U node reaches that value one third of the way across, and so the Step function produces black for the left hand third, where U is less that 0.33, and white for the right hand two thirds, where U is greater than 0.66.

Next comes the cyan. This is made up of two primary colours (Red=0, Green=1, Blue=1). This averages out as 0.66. The U node reaches this value two thirds of the way across, so the cyan band is black for the first two thirds, and white for the last third.

Finally, the pale yellow contains elements from all three primary colours (Red=1, Green=1, Blue=0.5). This averages out at 0.83. Thus the yellow bands are higher in value that the U node almost all of the way to the right edge of the node.

Sample Materials Using Step

Candy Stripe


PoserWorld