Render Tree nodes in XSI

By Adam Sale

In this tutorial we'll use some of the stock rendertree nodes to create a wicker basket. Transparency mapping is an excellent way to preserve geometry and create extra detail in your creations At a low cost in terms of resource consumption.

We'll be using a grid node, as well as fractal, Mix2 color,incidence, scalar to color, and color correction nodes.

Drag and drop this link into a 3D viewport to open up the basket scene. Its a simple basket type object that was created as a NURBS object. I've used NURBS to take full advantage of its UV mapping capabilities.

Turn your C viewport into a rendertree, and your A viewport into a property editor.

With your basket selected (not the ribs), update the rendertree and apply a Phong Material. For the moment, don't worry about defining colors from within the phong property editor.

We'll be adding nodes to the various inputs of the phong material node. These new nodes will in turn drive the colors and texture of the basket.

The Grid Node

From the nodes pulldown menu in the rendertree, select a grid node. Connect its output to the transparency input on the phong node Draw a render region (Q) around your basket in viewport B to see the results. The image that shows doesn't look too promising.

Click on the grid tab, and adjust the colors of the fill to White (1,1,1 RGB) and the line color to Black (0,0,0 RGB) The stark contrast will allow for the lines to become totally opaque, while the fill becomes completely transparent. The lines, however, still need sharpening. Set the diffusion of the grid texture to a tiny number... I used a value of 0.001 to create a slight blur on the edges of the lines. A value of 0 may look too harsh. You can also set the U and V width of the lines to a smaller number like .1 to create smaller wicker strands.
First, you'll need to define a texture space for the grid texture. In the rendertree, double click on the grid node to bring up its property editor. In the texture tab, click on the drop down menu and select a UV texture space. The grid texture will wrap properly around the basket, conforming to the contours in the U and V direction. The size of the grid is still quite large, and is much too diffused for our purposes. As well, the line and fill colors aren't exactly stunningly convincing.
Next, we can up the number of repetitions of the grid lines in both the U and V directions to add more wicker strands into the mix. Click on the advanced tab and adjust the number of U and V repeats to a suitable number checking your render region as reference. I chose 12 and 12 as my magic number.

Specular Highlights

The specular is annoyingly bright, so lets turn its intensity down by adjusting the RGB values of the phong slider to a color closer to black. We can also spread out the highlight by adjusting the decay slider to a low number like 15.

The basket is starting to look a lot better. Lets now work at defining the color of the wicker fibres.

Fractal Node

From the rendertree pulldown nodes select a fractal fractal texture node, and connect it to the diffuse node of the phong shader.

In the fractal property editor be sure to define a texture space for the fractal. I simply reused the UV space I created for the grid node In the fractal tab of the fractal node, give the two colors a wicker like color. I chose more earthy colors for my settings. In the advanced tab, set the repeats to around 4 and 4 in the U and V directions

Incidence Node and hook ups

The edges of the basket look a little thin, it seems as though the wicker could use a bit of thickness around the sides of the basket. The incidence node will serve an admirable purpose here. In most examples you''l see it used to create a more realistic glass shader by shading areas of an object where the normals are at a user specified degree from that of the camera lens. In the case of glass, perhaps normals at angles of between 80 and 100 degrees in relation to the camera will be shaded darker than the rest of the object reulting in the thickness at the edges that create the look we're after. With our basket, we'll use the incidence node to thicken the edges.

In the render tree window under nodes>illumination select the incidence node. Its output is scalar (green) and won't readily plug into the transparency node of the phong shader, so we'll need to convert the incidence node into a color node so that the transparency input can read the information. Under nodes>conversion, select the scalar to color node.

We'll control the effect using a color correct node. You can bring it into your render tree window by opening up node>image processing>color correction.

 

Finally, since the transparency node of the phong shader is already being used by the grid node, we can use a mix2color node to mix the result of the incidence and grid effect, and plug the result back into the transparency node of the phong shader. Under nodes>mixer select the mix2color node.

You should now have four nodes in your render tree that will need hooking up. Connect the output of the incidence node into the input of the scalar to color node. Then connect the output of the scalar to color node into the input of the color correction node. Connect the output of the color correction node into the color 1 input of the mix2color node.

Putting it all together

Since we'll need to use the transparency node of the phong shader for the incidence effect, unplug the grid node from the transparency input, and instead plug it into the base color of the mix2color node. Connect the output of the mix2color node into the input of the phong shader transparency node. To drive the weight of the mix2color node plug the output of the grid node into the input of the mix2color weight node

To adjust the thickness of the incidence effect, play with the various sliders in the color correction node PPG. I upped my gamma to 1.2 to tweak my incidence value.

Finally, whats a wicker basket without twisting wicker strands. Our current basket has strands that run vertically and horizontally. Pretty boring. Select your basket hierarchy as a tree in an explorer and apply a twist operator to finish things off.
Render Tree Nodes in XSI was written by Adam Sale, Technical Director at Joncrow Entertainment. Adam is a fully certified Softimage Instructor who teaches at various institutions throughout Vancouver. He can be reached at adamsale@home.com