The render tree lets you connect shaders—or nodes—together to build a visual effect. Each node exposes a set of properties that can be dynamically linked by connecting the output of one shader to the input of another. This is called dynamic property assignment and is as simple as dragging a connection line (arrow) between the input and output attachment points of the shader.
In the render tree, a shader is presented as a container; that is, you cannot change its internal content, but you can extend it by connecting nodes to augment its effect.
|
The render tree does not let you change the internal structure of a shader or build your own from scratch. You can, however, create your own shaders using the SOFTIMAGE|SDK. For more information about creating and integrating custom shaders, see Help > SDK Guides > SDK Customization Guide > mental ray Shaders. |
Besides shaders, render tree nodes can also be textures or functions known as tool nodes. Each type of tool node performs specific operations; for example, tools nodes can be used as pattern generators (to create noise, for example), mathematical functions (such as multiplication), converters (to convert a scalar value to a color RGB value), mixers, blends, and so on.
A shader provides a number of properties that you can control. You can set constant values for these properties or you can attach tool nodes or other shaders to these properties to procedurally control their values.
A render tree makes it possible to use a texture or a texture shader to control a component of the shading calculation. For example, you can use a 2D or 3D texture as the color, specularity, or reflectivity of a material. This means that the inputs to the shading model can be manipulated procedurally. Color and transparency textures, reflection mapping, bump mapping, displacement mapping, and solid texturing can all be implemented using the render tree.
To open the render tree
1. Select the object whose render tree you want to open.
2. Do one of the following:
- Click the arrow or the name of the current view displayed on any viewport title bar to open the View menu and choose Render Tree.
or
- Choose View > Rendering/Texturing > Render Tree from the main menu, or press 7 to open the render tree in a floating window.
You should see the selected element’s material node, and any connected nodes, displayed as a render tree.
3. If desired, activate the render region tool (press q) and draw a render region so that you can interactively preview the effect you are building in the render tree.
4. You can now begin getting and connecting nodes as described in Building a Render Tree.
If you are unfamiliar with the render tree, it is recommended that you start by reading Where to Start. That section should give you a good idea of what you’re seeing when you open the render tree.
Setting Render Tree Preferences
You can set preferences to control some of the default render tree attributes such as the style of the connection lines and the default state of nodes (collapsed, expanded, and so on).
To set render tree preferences
1. From the main menu, choose File > Preferences top open the Preferences view.
2. In the explorer pane, select Editors > Render Tree to open the Render Tree Preferences property editor in the right pane.
3. Set the preferences as desired. See Render Tree Preferences for information on each option.
Realtime Shaders and the Render Tree
Realtime shaders are designed to take full advantage of the render tree. In fact, because realtime shader have no connection icons in their property editors, the render tree is the only place where you can connect them to one another. Although this chapter does refer to realtime shaders, it does not discuss building realtime shader trees in detail. For more information about building realtime shader trees, see Building Realtime Shader Trees in the Realtime Shaders guide.
In most ways, realtime shaders look and behave like mental ray shaders in the render tree, but there are some differences. As such, here are a few things you should keep in mind when building realtime shader trees:
• The material node’s RealTime port is the only port that can accept realtime shader connections. Realtime shader effects that you create in the render tree are applied to an object’s material through this port.
• Most realtime shaders have very few ports. Each one has a Previous port that accepts a connection from the preceding realtime shader. Those that define textures can also accept textures from image clip nodes.
• You cannot replace realtime shaders by dragging new shaders from a browser and dropping them on existing shaders in the render tree.
For more information about realtime shaders in general, see the Realtime Shaders guide.
Texture Layers in the Render Tree
When a shader has one or more texture layers, a new section called Layers is added to its node in the render tree. The Layers section contains a parameter group for each of the shader’s layers. Expanding the Layers section reveals all of the individual layer parameter groups. Expanding an individual texture layer’s parameter group reveals the ports for its Color and Mask parameters.
Layers behave exactly like any other parameter group in the render tree, meaning that you can connect shaders to texture layer parameters as you would to any other shader parameters. This allows you to control each texture layer with its own branch of the render tree!
For more information about layering textures, including how to work with texture layers in the render tree, see Texture Layering in the Texturing guide.
For more information about collapsing and expanding texture layers in shader nodes, see Collapsing and Expanding Parameter Groups and Texture Layers.
MetaShaders in the Render Tree
MetaShaders are multi-implementation shaders that are capable of supporting several renderers simultaneously. Many of the shaders in XSI’s shader library are MetaShaders, supporting both the mental ray and Cg renderers. In the render tree, MetaShaders behave exactly like any other shader. You can identify them in two ways.
• In the Nodes menu, all shaders have a letter next to their names, which identifies their output type (“c” for color, “s” for scalar, and so on). MetaShaders have a “m” next their names in addition to this letter.
• A small “M” appears directly above MetaShader nodes. If you expand a MetaShader node, the renderers that it supports are listed in a separate section at the bottom of the node.
SOFTIMAGE|XSI v.6.01