modo bubbble logo

Shader Tree


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

back next
comment balloon Comments (0) RSS Icon
0/5 (0 votes)

modo employs a unique global shading model for surfacing, allowing attributes to apply to any number of layers or items within a scene or, if desired, even apply to the entire scene very easily. The basics of shading any surface begin with applying a polygon tag (shown here). This determines where the surfacing attributes will be applied during render time. Once those tags are applied, the actual shading itself is controlled by the layers of the Shader Tree. These layers determine if a surface will be shiny or dull, red or green, transparent or opaque or whatever the millions of surfacing attribute combinations that can be applied. Found in the 'Shading' viewport, the Shader Tree has two distinct modes for operation. The 'Material' mode which simplifies assigning surfaces and applying surfacing, and the more advanced 'Shader Tree' mode giving full control to the shading and rendering of the scene. If you have never worked with modo before, it may be helpful to make sure you are comfortable with the viewport UI, by referring to the Shading Viewport page of the documentation, however it is not essential.

Shader Tree View Modes

shader tree viewport   Materials Panel
Default views of the same simple scene for the 'Material' and 'Shader Tree' modes of the Shading viewport.

Before covering how to work with the Shader Tree, it should first be explained how the two view modes of the Shading viewport differ. In the top left of the panel there is a 'View' option, LMB+clicking the button offers two choices for users- 'Materials' and 'Shader Tree'. They are similar in many respects, but their difference will make surfacing tasks easier for certain workflows.

The 'Material' mode of the tree is meant to only displays the 'Material' tags of selected item layers; any unselected background elements won't show up. This behavior is enabled by toggling the small 'S' button next to the 'Add Layer' button (think 'S'elected). By only viewing the tags of the selected items, the number of layers visible at any time is reduced, providing a more streamlined workflow (demonstrated above). Also, the Tags are displayed alphabetically in this mode, making it easier to find a specific layer.

In 'Materials' view mode each individual tag operates as a layer, using hierarchy to define how surfacing is applied. By toggling the preceding arrow arrow an associated material item is made visible, this is the same item as in Shader Tree mode and represents multiple aspects of the final rendered surface. New tags can be applied to any target geometry by first selecting the surface in 'Polygons' selection mode and pressing the 'Assign Material' button in the viewport, or by pressing the 'm' keyboard shortcut. This opens a dialog allowing users to customize the tag name. Clicking 'OK' will then add the resulting tag as a layer to the tree. Additional layers can also be added to individual tags to control other shading aspects of the surface by LMB+clicking the 'Add Layer' button and choosing from any of the numerous options. This is covered fully further below, but just know that each layer added will apply only to the tag that it is placed within.

To provide the simplified workflow of the 'Materials' mode certain layers aren't visible in the tree, Environments can't be edited directly, nor can any Shading and Render Output edits be made. These are done while in the 'Shader Tree' mode. The 'Shader Tree' mode displays the entire tree as it will be evaluated for rendering. In the Shader Tree, tags aren't displayed directly, but are replaced by the Material Group mask layers. Hierarchy plays a role here as well, where surface shading is constrained by the masks defined by the Material Groups.

Understanding the Shader Tree

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 supersede 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. Click this button to show a video demonstrating a simple example that illustrates 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 evaluated at render time, higher layers in the tree supersede 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 dependent on another, and it isn't working, sometimes changing the layer order can solve the issue.

Hierarchies

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

Effect Column

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 affect 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 itself in the effect column and selecting a new effect 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

Shader Tree Top

At the top of the Shading viewport, under the View option is the 'Filter' control. This determines how layers are displayed within the viewport. The 'Filter' control 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, filtering will only display Shader Tree layers applied to currently selected item(s).

 

Searching Layers

Find

Next to the 'Assign Material' button is a small 'F' button that opens the 'Find' functionality allowing users to seeach for layers based on thier name. When the button is pressed (enabled) the search bar opens. Typing some text into the input field will isolate only the Shader Tree layers that contain the same string. There are two modes for the Search Function that are designated from the arrow drop down- 'Simple Search' will locate layers based on mathcing the exact input (including spaces), so typing "1 2" will locate "Apple1 2" and "1 2Banana", but not "Apple12" or "2Banana". The 'Pattern Matching' option allows for a more robust type of search allowing for symbolic characters. This is covered in-depth on the Shader Tree UI page of the documentation. Enabling the 'Match Case' option will furth constrain the search to also matching the upper and lower casing of the alphabet characters. The 'Flat' option will toggle the indentation of the layers in the panel making it easier to locate specific layers.

 

Using the Library

The Shader Tree has a Library function that serves to store surfacing definitions that can then be applied to Material Group items elsewhere in the tree. When the Library material is updated, the changes are propagated to all the references in the tree. This can be useful to reduce the number of total layers required in the Shader Tree as well as simplify workflows where identical materials are used multiple times for different surfaces.

Use of the Library is easy, users can drag and drop Preset materials to the Library section of the Shading viewport (custom materials can be created as well, as long as they exist under a single Material Group item). To apply any of the Library items to a surface, LMB+click the top most Material Group item in the Library and then drag and drop this into the target location in the Shader Tree, most likely inside another Material Group, masking it. This drops a named Reference item "" into the group that represents the Shading of the Library item. Any updates or additions made to the Material Group in the Library are propagated to all the associated references throughout the Shader Tree. Like standard Shader Tree layers, placement of the layer within the tree determines Shading, but Library references cannot be masked or modified directly. To convert a Library reference to standard Shader Tree layers, RMB+click on the layer and apply the 'De-Reference' command.

Tip icon

TIP: When creating Library materials, Shader Tree Material Group layers (and their hierarchy) can also be dragged and dropped into the Library, however, any masks generated by the Material Group itself will be retained in the Library item and will therefore need to be disabled before its creation or the resulting surface will not properly evaluate.

 

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 will 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 making Render Passes, applying a variety of textural options when rendering out conceptual product stills, and experimenting with alternate shading options while exploring looks for a scene.

 

Contextual 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 specified layer.

Editor Color: 12 color options are provided for colorizing the Shader Tree layer itself, meant to be used as an visual organizational device. Choosing any of the colors from the supplied menu will apply the selected color as the layer background.

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

Select Polygons: This command will make all the polygons in the scene related to the current mask selected, switching the modo interface into 'Polygons' selection mode if not already active.

Duplicate
: 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 source; changes to one layer automatically propagate to all instances. Instanced layers are denoted by their italicized name in the Shader Tree. Especially useful when separate surfaces with identical properties reside within different masks. When instances are used, changing one items attributes automatically clones the changes on the instance. Changes to the Instance itself act as local overrides, modifying the attribute directly, while changes are not applied back to the source of the Instance. Further changes to the source will be propagated except to those changes made individually on each Instance, on a channel by channel basis.

Lock/Unlock Preset: When the 'Lock' command is applied to any Library material, this will prevent any accidental changes from being applied to the Material Group. The target layer will need to be Unlocked for further editing. The Lock/Unlock commands have no effect on standard Shader Tree layers.

Select Instances: If a layer has any Instances of it in the Shader Tree, the 'Select Instances' command will select all the associated Instances of the target automatically.

Select Source of Instance: The 'Select Source of Instance' command will select the parent source items of any instance. Instances are denoted by their Italicized name in the Shader Tree.

Reference/De-Reference: (only available when RMB+clicking over Material Group item) A Reference acts similar to an Instance, but works to clone all layers within a Material Group item, instead of just a single layer. Referencing a Material Group will clone the entire group hierarchy as a single layer that can be applied elsewhere in the Shader Tree. To create a Reference layer, RMB+click on the target Materials Group item (it must contain at least one layer) and select the command "Reference". LMB+click on the resulting reference item and drag and drop the layer into another Shader Tree location to see the results. Changes made to the Source will be propagated to the Reference layer(s). Reference layers cannot be modified directly, unless the 'De-Reference' command is applied converting the Reference back to standard Shader Tree layers. 'De-Reference' will also convert Library References to standard layers. (References essentially operate like Library items, but outside of the Library folder)

Copy
/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
: A 'Preset' stores settings so they can be applied at a later time. In the case of Materials, a preset stores Shader Tree layers with an associated icon for visual browsing in the 'Preset Browser'. A Material 'Preset' can be as simple as a single layer, or it can contain any number of layers with complex blending. For multi-layer 'Presets', these must all be contained under a single Material Group "icon" item. RMB+clicking on the target layer and selecting the "Save Preset" option from the contextual menu will present the user with an OS dialog prompting where to save the 'Preset' itself. If one wants the resulting Preset to show up automatically within the default Preset Browser structure, It will be necessary to navigate to the directory where Presets are stored and save in an appropriate folder. One can also create a new directory for saving presets, but make sure to use the '(add path)' command in the Preset Browser to make it visible within the browser viewport. Once the File is saved, a default icon will be generated that represents the settings of the Preset. If you prefer to produce your own custom icon, this can be generated ahead of time and assigned with the 'Save Preset with Thumbnail' command.

Save Preset with Thumbnail...: The 'Save Preset with Thumbnail' command works in the same way as the 'Save Preset' command above, but once the preset is saved, a second dialog opens allowing users to specify any saved image that will then be used as the browser icon.

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 to File: The 'Bake to File' command is functionally identical to the 'Bake to Texture' command above, but writes the resulting texture as a file to disc to a location specified by the user. When applying the command, a OS file requester opens to specify the file name, locations and format. The second dialog is where the resolution and bit depth are specified. When saving to a 16 bit or greater format, the 'Floating Point' option must be enabled.

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 requester 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.

Reload Image: This command reloads the image as saved to disk. Useful for when edits made in an external app don't trigger modo to reload it automatically or you wish to undo a series ofinternal edits all at once.

Replace Image: This command opens a OS file requester dialog allowing users to select an alternative bitmap image that will replace the selected image, while retaining its exisiting setttings.

Open Image Folder: This command opens the saved files Folder location on the internal hard disc using the systems default file manager.

 

Top

back next