modo bubbble logo

Advancing the Shader Tree


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

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

The Shader Tree is both immensely powerful and tremendously flexible. It is this flexibility that can lead to it feeling unwieldy at times. Based on user feedback, it was a design requirement to allow materials and textures to be applied at any level in the scene; even globally if necessary, but as the saying goes, "With great power comes great responsibility". The result is user diligence is required to keep the Shader Tree organized and the effort necessary increases as the complexity of a project increases. Understanding how to work with layers in the Shader Tree and what each contributes is an important start in wielding the power that the Shader Tree provides. The basics are covered on the Shader Tree, Shader Tree Items and Layer Effect page of the documentation. Beyond the basics covered on these pages, it was important to add an additional page to go over some more advanced aspects of the tree.

Groups and Groups

The number one most important item in the Shader Tree is the Material Group item. In the 'Add Layer' function of the Shader Tree, it is simply referred to as a 'Group', but here I'm calling it a 'Material Group' to avoid any confusion with 'Groups'. The Material Group serves multiple purposes and understanding its few settings are extremely important in getting the most out of them. When users add a Material Group item to the tree, they are simply empty containers. These containers can hold any number of layers, including collections of other groups. In this case, they are strictly organizational devices, providing hierarchy to a scene, for instance associating like materials to an item in the scene, making it easier to navigate a complex tree. This can be illustrated by selecting a few layers in the tree and pressing the 'Ctrl+G' keyboard shortcut, grouping together like materials under an undefined Material Group item.

The Material Group item also provides the principal means for applying materials to surfaces by way of masks. By defining Items and/or Polygon Tags in the items 'Properties' panel, any contents (i.e. layers) within the Material Group can be limited to only affect geometry surfaces that carry that specific tag in the scene. This is done automatically every time a user applies a Material tag using the 'M' keyboard command. Users press 'M' opening the 'Polygon Set Material' dialog box. Defining a name and pressing 'OK' will generate a Material Group item in the shader tree automatically setting the 'tag type' and 'tag name' options to the particular name the user defined.

 

Masking Surfaces

While the Material Group is an easy way to surface geometry for rendering, its reliance on polygon tags limits what is possible with just Material Groups, therefore modo provides several other ways to mask textures that provide much finer control. The masking functions combined with the layering possibilities of the Shader Tree makes it simple to produce very complex surfaces with ease. Whenever a mask is applied underlying layers can be revealed.

Group Masks
The 'Group Mask' is a Layer Effect option, defined for a layer in the 'Effects' column of the Shader Tree. It allows the contents of an entire Material Group, regardless of complexity or number of layers, to be masked by using any single texture item. The texture can be a procedural texture such as a Noise layer, an image map or even a weight map using the Weight Map texture layer. The use of image maps provides very fine pixel-level control. Users can create these images externally using an image editor, or paint them directly in modo using the built in paint tools. The use of gradients opens up a number of interesting possibilities as well, where Material Groups can be masked by the numerous gradient input parameters, such as slope or incidence angle.

Layer Masks
The 'Layer Mask' result is similar to the masking functionality of the 'Group Mask', but it application is limited to a single layer within the Shader Tree providing even more granular control. There are two ways to apply a layer mask, either choosing the 'Layer Mask' effect and placing the layer directly below the layer the user wishes to mask, or by simply dragging and dropping the layer onto the target layer (therefore automatically defining it as a layer mask effect). Users can modify the settings of the texture layer, toggling the visibility of this kind of mask using the '+' icon preceding the layers name.

Alpha Channels
Modo opens and respects embedded alpha channels or layer transparency on imported image map layers. Their actual application can be a point of confusion because some users are surprised when they can't see-through their surface in the transparent areas of the image map. This is because modo respects the alpha channel for the image map as a texture layer (revealing any lower surface shading), but it doesn't serve double-duty as 'Transparency' (or 'Stencil' or 'Dissolve') for the surface when set as the default 'Diffuse Color' effect. Users would need to also apply the image as a 'Layer or Group Mask, or assign the Alpha channel as 'Transparency' (utilizing the 'Alpha Only' option of the images properties). Additionally, users can simply use the 'RGBA' layer effect to designate both diffuse color and transparency in a single layer.

By virtue of how modo handles alpha transparency for a image maps, this makes it possible to layer any number of transparent images and combine the result into a single complex surface. Even when painting, using transparent image layers, Photoshop-like multi layered images are possible by stacking several image maps layers with Alpha channels. User can simply select the layer in the Shader Tree to designate which image receives the brush strokes while painting, leaving other layers unaffected.

Item Masks
Within the Material Group item, users can specify item masks in addition to the other setting. Item Masks can be extremely useful limiting the application of images or shading to a specific mesh item, without resorting to a bunch of different polygon tags. This makes it possible to apply different shading or image maps to an Instance simply by specifying the Instance items name in the Item mask property of the Material Group item.

 

Layering Surfaces

Not only can users layer images and textures in a single material, users can also layer tags for interesting results. The polygons tagged do not have to be identical, or even similar. Its therefore possible to create a 'Selection Set' that spans polygons from two separate material surfaces, define it as a mask and apply an image that straddles the two surfaces. Use a straight material tag for the two regular surfaces and then assign the smaller areas the Selection Set with a custom UVs to apply labels and such.

 

Cleaning Up the Shader Tree

On occasion, users may find the Shader Tree encumbered with unnecessary layers that need to be removed. Choosing which to delete can be difficult. The 'Purge Unused Materials' command will remove all Shader Tree material and/or texture layers that do not contribute toward the final rendered image, including those that reference unassigned Polygon Tags. These could occur when geometry is deleted, or new tags are assigned, as polygons can only hold a single material or part tag. It also possible when moving items layers into a scene from another that extraneous layers are added. To use, simply select the command from the menu bar 'Texture > Purge Unused Materials'.

 

Some Additional Notes-

Users often forget that texture items such as image maps and procedurals can be added to lights and environments. By adjusting their 'Projection' types and 'Effect' settings, a whole range of interesting effects can be obtained.

Texture layers can be used to mask any other types of layer, including 'Surface Generators' and 'Fur'. The only layer that cannot be used as a mask for Surface Generators or Fur is the 'Occlusion' layer; since it requires rays to be fired to calculate, this only happens at render time, and it is therefore too late in the process to have produce the intended result. In these cases users should bake the occlusion layer out to a image map texture and then reapply the image map in place of the occlusion.

 

comment balloon Comments (3) RSS Icon

Dominiek De Ridder April 9, 2012 at 11:59 PM

Videos on LuxTV :

Masks_Part_1_Understanding_Masks :
http://www.luxology.com/tv/training/view.aspx?id=248

Masks_Part_2_Masks_and_Shaders :
http://www.luxology.com/tv/training/view.aspx?id=249

Masks_Part_3_Masks_and_instances :
http://www.luxology.com/tv/training/view.aspx?id=247

Masks_Part_4_Masks_and_Render_Passes :
http://www.luxology.com/tv/training/view.aspx?id=246

Dominiek De Ridder April 26, 2012 at 1:14 AM

Video on LuxTV explaining how to add procedural textures to deformer falloff overrides (modo 601) :

http://www.luxology.com/tv/training/view.aspx?id=646

Dominiek De Ridder April 26, 2012 at 2:03 AM

VIDEO on LuxTV by Brad Peebler : Selection Sets for masks to add detail to a tiled roof :

http://www.luxology.com/tv/training/view.aspx?id=564

Top

back next