![]() |
|
N-Node Settings |
| Home | Tutorial Links | My Tutorials | Sample Materials | Freebies |
Home > My Tutorials
N NODE1: What is it?The N Node outputs the scene normal of each point on the current object. The normal is the direction that the current surface is facing. The N Node produces three numbers - X, Y and Z. If you plug the N Node directly into any input that expects a colour, then X becomes red, Y becomes green and Z becomes blue. Figure 1.1 shows the N Node plugged directly into the diffuse colour input of an unrotated cube. The right hand face of the cube has a normal of x=1, y=0, z=0, which here is turned into red. The top face has a normal of z=0, y=1, z=0, which turns into green. Finally, the front has a normal of z=0, y=0, z=1, which becomes blue. The opposite faces of the cube will all be black, as negative numbers are taken to be zero when calculating colours (see below for altering this behaviour). 2: Extracting parts of the N NodeInverting the outputThe basic N Node produces positive results for surfaces facing up, right or towards the front of the scene. If you want to get positive results for surfaces facing left, down or away from the front of the scene, you will need to use the subtract maths function.Figure 1.2 shows how to do this with the colour mathes node. Another way to invert the output of the N Node is to simply reverse the numbers in the N Node itself - set any of the values to negative numbers to reverse the outputs. Getting both directions.If you want to got both top and bottom, left and right or front and back, then you will have to use the Abs maths node. This leaves positive numbers untouched, but turns negative numbers positive.
Converting to a single numberNormally, you will want to convert the output of the N node from the three X Y and Z results into a single number that can be fed into a the input of another node. The easiest way to do this is to plug the N Node straight into the target node, and then play with the X, Y and Z settings on the N Node itself to control the results.If you do this, or modify the N Node with any of the normal maths nodes, then the result is produced as a shade of grey that can be expressed as a single number. Logic would suggest that with a normal, unmodified N Node, this scale runs from -1 to +1, but this is not the case. The table below shows the output range produces from one, two or three dimensions.
Controling the N-Node to produce different directionsBy combining the three N-Node settings, you can produce just about any direction that you want. Figure 2.1 shows the settings for the front facing directions (on the Octagon) and those parallel to the scene (around the edges). To get the rear facing directions, use the same settings as for the front, but change the Z setting (the third number) to -1. Different multiples will produce more subtle controls. Experiment with different combinations to find the exact settings that suit your material. 3: How does it behave?The N Node produces Scene normals. That means X will always point to scene right, X forward and Y upwards. If we move the camera, our viewpoint will change but the results of the N Node will not, but if we rotate the object, the N Node will produce different results. We will demonstrate this on Jessie's head. In the first picture, we have plugged the N Node into the diffuse setting on Jessie's head, and then extracted the Z element. Those parts of Jessie's head facing forward are shaded blue. In figure two, the camera has been rotated. The same bits of the head are shaded blue, as the figure itself is still pointing towards the front of the scene. In figure three, the camera is back where it started, but the head has been rotated. Now the side of the head is shaded blue, as that is the part of the object facing towards the front of the scene. Finally, in figure four both the camera and the face have been rotated. The same part of the head is shaded blue as in figure 3, because that part of the head is still facing towards the front of the scene. |