modo bubbble logo

Shader Tree

Home >> Shade, Light & Render >> Shader Tree

back next
comment balloon Comments (1) RSS Icon
4.5/5 (2 votes)

Before working with the shader tree, please make sure you are comfortable with the viewport UI, by referring to the Shader Tree Viewport page of the documentation.

shader tree viewport

Understanding the Shader Tree

All the shading and surfacing of any scene is handled by the shader tree. This is where specific surface attributes are specified, such as what color a surface is, or how shiny it is. It is also where settings for global illumination, environments, and how the scene is rendered are specified. The shader tree is so named because it is conceptually similar to a tree where the 'Render' item "render item icon" can be considered the trunk with each individual 'Material Group' item "material group icon" the branches. Each branch can contain other 'material groups' nested inside for different layering effects. Eventually, all these layers, nested or otherwise, feed into the 'Render' item, this information is then fed into any 'Render Outputs' "Render Output icon" producing the final rendered image when users activate any of the render commands. To produce the final result, layers are processed in a bottom to top fashion. Anyone familiar with Photoshop's layers palette will be instantly familiar with how modo's shader tree works as any opaque layer above another will always supercede the underlying layers, obscuring them. They can only be made visible by either changing the transparency of the upper layer, changing the blending mode or by applying a mask to the layer.

Let's look at a simple example to illustrate the layered items concept that is the basis for the shader tree.

Adding & Modifying Shader Tree Item Layers

While the shader tree does control the shading and rendering of any scene, the main functionality of the shader tree itself is for adding, removing, organizing and otherwise managing the many shader tree item layers. When adding new items to the tree, the various item layers can be added by LMB-clicking the 'Add Layer' option of the full viewport window and selecting an item from the pop-up context menu. New items are always added to the top of the list in the shader tree directly below the 'Base Shader' "base shader icon" item. In cases where a 'Material Group' "material group icon" Item is selected, new layers are added within that subgroup, directly below the group item itself. For information regarding which types of layers can be added, please see the Shader Tree Item Layers page of the documentation.

Any of the editable properties related to item layers appear within the 'Properties' viewport when the layer is selected in the shader tree. Selected layers are indicated by the dark bar highlighting the layer name. Multiple non-consecutive layers can be selected by holding down the 'Ctrl' key on the keyboard and LMB clicking subsequent layers in the list. Consecutive layers can be selected automatically by holding down the 'Shift' key on the keyboard, and LMB clicking on a new layer; any layers between the current and active selections will be selected as well. Multiple layer selections of identical item types allow for gang editing of property values, eliminating the need to individually adjust item properties.

For organizational purposes, users may wish to rename layers, which can be accomplished by selecting the target layer and choosing the menu bar command "Item > Rename", this opens a dialog box where users can enter the new name, LMB+clicking OK assigns the new name, but be aware, if multiple items are selected, including anything in the Item List, all selected items will receive the new name. To avoid this from happening, it is better to use the 'Rename' option from the popup context menu when RMB+clicking on the layer name itself. Finally, users may also inline rename a layer; simply LMB+click-pause-click directly on the layer name and then type a new name inline, pressing the "enter' key when done to accept the change.

Any layer within the shader tree can repositioned by LMB click and drag the layer, moving it to a new position. The orange line that appears when dragged, indicates the position the item will take when the mouse button is released, dropping the item. When nesting layers within a material group, the layer will inherit the mask, if any, specified by the material group item. Layer positions are an important concept of the shader tree as they control the order in which items are calculated at render time, higher layers in the tree supercede lower layers.

Layers can be easily removed by selecting the target layer in the shader tree and from the menu bar, select the command "Texture > Delete Shader Tree Layer". Also, by RMB clicking the layer to open the contextual menu and selecting 'Delete'. Finally, selected layers can be removed by pressing the 'delete' key on the keyboard.

Tip icon

TIP: When assigning layer order, remember the tree works bottom up; when setting a layers 'Effect' to 'Layer Mask', it will only mask the texture layer directly above it. Also, gradients that use other layers for 'Input Parameters' need to be below the gradient itself so the layer is calculated first to feed into the gradient. If a layers effect is dependant on another, and it isn't working, sometimes changing the layer order can solve the issue.


Hierarchies are quite important to the shader tree; as this is how associations are made to material groups, which generate the masks necessary to limit surfacing to individual sections of geometry. Any item that is a child of a material group will inherit the group items mask settings. Hierarchies are denoted by the small indentation in subsequent item layers. Material Group items that contain child layers are preceded by a small triangle "Arrow Icon" icon. LMB clicking the arrow will toggle the hide/reveal action of the nested layers. Successive nested material group items will be further indented indicating their association to the parent item. The Parent/Child associations are created by dropping a layer onto another closed group, or between two layers of an open group. When adding new layers, selecting the parent material group item prior to selecting the new item layer type will nest the new layer inside the group. Finally, if a texture layer, procedural, image based or otherwise, is dropped onto another texture layer, the dropped layer automatically becomes a layer mask to the parent. Masked layers are preceded by a small "+" icon, click the icon to toggle the view of the items mask which is now also indented to show its relationship to the parent item.

Tip icon

TIP: The key to a smooth workflow is organization when it comes to the shader tree; if left unattended, materials and groups could quickly stack up leaving a long unwieldy list that is difficult to navigate. Multiple material groups can be further grouped by multi-selecting several layers using the shift and ctrl modifier keys. Once selected, press 'Ctrl-G' on the keyboard to move the highlighted layers into another group. When used this way, the groups properties are set to (all); when set as such, the group merely provides a means to organize multiple material groups. The resulting 'Group Item' can be renamed either by RMB clicking the title and choosing 'Rename' from the contextual menu, or by 'click pause click' for inline editing. Grouping items layers can greatly simplify the visual appearance of the shader tree list, making it much easier to navigate. Users can quickly expand and contract all nested layers within a hierarchy by pressing the 'Shift' key when toggling the arrow ' arrow' icon.

Specifying Layer Effect

By default, any new texture layer added to the shader tree will modulate the 'diffuse color' channel, meaning the layer will affect the apparent visual color of the surface. Should you wish to effect the surface differently, such as specifying a layer as a bump or displacement map, this is specified via the 'effect' column of the shader tree. A layer can be set to modulate a specific effect, by way of a RMB click over the effect name in the effect column and selecting a new type from the pop up contextual menu. Individually, all of the Texture Effects are covered on their respective documentation pages. Whenever a texture layer is created, such as an 'Image Map' "Image Map Icon" or a procedural texture "Procedural Item Icon", an associated 'Texture Locator' is added as well to the 'Item List'. Texture Locators hold position and projection settings specific to the texture layer and define how it is applied to the surface, while also providing a means to animate the texture using basic transforms applied with keyframes to the locator itself.


Filtering the Item List View

Across the top of the viewport are two buttons, one that allows users to filter how layers are displayed within the viewport, and a second used to add additional item layers to the tree. For more info on adding layers, please see the Shader Items page of the documentation.

Shader Tree Top

The 'Filter' function always defaults to the '(none)' value, which displays all items within the shader tree. Alternate options available in the menu can be selected by clicking the small triangle widget to the right of the bar. When any of the other options are selected, they temporarily toggle the visibility of the items in the list, without removing or disabling them, making it easier to locate a specific layer, or to make selections for gang editing multiple items easier.
The options include--
Material-- Displays only Material Items "icon" in the shader tree.
Texture-- Displays only Texture Items "icon, icon" in the shader tree.
Group-- Displays only Material Group Items "icon" in the shader tree.
Shader-- Displays only Shader Items "icon" in the shader tree.
Render Output-- Displays only Render Output Items "icon" in the shader tree.
Fur Materials-- Displays only Fur Material Items "icon" in the shader tree.
Filter on Selection-- When this option is enabled, the filtering will only display filtered items from the selected item down the branch.

Toggling Layers

Sometimes a user may wish to toggle the effect a layer has on a scene without removing the item from the list. This can be accomplished by LMB clicking over the eye icon "eye icon" within the visibility column on the left side of the viewport. Toggling a layer disable/enable its affect on shading in the scene, but the item itself will retain all settings and remains part of the shader tree list when scenes are saved or closed. The ability to toggle layers can be extremely helpful in a variety of scenarios, including creating various shading passes that users would want to enable and disable when rendering, applying a variety of textural options when rendering out conceptual product stills, and experimenting with alternate shading options while exploring looks for a scene.

Context Menu
Additional options for working with the item layers are available by RMB clicking on an item layer name and choosing an option for the pop up contextual menu

Shader Tree Contextual Menu

Rename: Allows the user to assign a new name to the specific layer.

: Opens the 'Properties' viewport with the selected layers corresponding settings.

: This command will create a copy of a layer with identical settings. Changes in the original item are not reflected in the duplicate layer, nor are modification to the duplicate reflect in its original layer.

Create Instance
: Creates a clone of a layer that references the original; changes to one layer automatically propagate to all instances. Especially useful when separate objects with identical properties reside within different masks. When instances are used, changing one items attributes automatically duplicates the changes on the instance.

/Paste/Delete: Entire layers, as well as the settings of individual layers themselves can be copied, pasted and/or deleted using these commands. When pasting values from one layer to another, the layers must be of the same type, i.e. material item to material item.

Preset Browsers Palette
: This command opens a 'Preset Browser' palette.

Save Preset
: Any layer in the shader tree can act as a preset. When one selects 'Save Preset..." a file save dialog is presented asking where you'd like to save your preset. If you want the preset to show up automatically in the default structure, you'll need to navigate to the directory where your presets are stored and save within that directory, one can also create a new directory for saving presets, but make sure to use the '(add path)' command so you can see them within the browser viewport. Often a surface made up of multiple texture layers, in that case make sure to create the preset from the material group "icon", as that will include all associated texture layers within the preset. Don't forget that Fur is made up from texture layers so making hair presets is just as easy as making surface presets.

Change Type
: This command offers the ability to convert a layer of one type, such as an image map to another type such as a procedural. Associated 'Texture Locators' will retain their settings if applicable but layers themselves will lose their settings.

Bake to Texture
: This command offers the ability to generate a texture map image of a layer. Baking textures from inside the Shader Tree is useful for baking a single "Effect" such as Color or Diffuse into an image whereas the "Bake" command from the Render menu bakes all light and texture contributors into a final shaded image. It is reasonable to think of the Shader Tree level of baking as similar to "Flattening" layers in Photoshop. Only layers of the same "Effect" setting underneath the texture layer that is triggering the bake will contribute to the baked layer. Once "baked" this texture can remain in the Shader Tree as a pre-computed result of all contributors which results in a savings of render time and provides a real-time view of the effect. The 'Bake to Texture' command requires a UV map on the baked surface as well as a blank image map to bake into. For more on baking textures, see the Baking Images Workflow page of the documentation.

Bake From Object to Texture
: This command offers the ability to use the UV map of a low polygon count model to bake a texture map from a higher polygon count model. Maps can be used for any of the various 'effect' including diffuse color, displacement and normal. Like 'Bake to Texture, a UV map is required and a blank image map to bake into. Both surfaces must have different material name and cannot share the same UV map. When calculating a displacement map, the 'distance setting' from the popup requestor should be used as the 'Displacement Distance' setting in the material dialog box when applied. For more on baking textures, see the Baking Images Workflow page of the documentation.


comment balloon Comments (1) RSS Icon

StuManFu December 17, 2010 at 8:24 AM

Bake From Object to Texture: Bear in mind you can only bake displacement. Not vector displacement. I know it doesn't specifically mention vector displacement but I presumed the word "displacement" referred to all kinds of displacement and wondering why it didn't work.


back next