modo bubbble logo

Nodal Shading Overview

Home >> Shade, Light & Render >> Nodal Shading

back next

Historically in MODO, all material shading for a surface was defined via the Shader Tree exclusively using a stack order paradigm. Layers higher in the list order would obscure the lower layers unless a mask was applied or its blending mode was changed. This method of working is incredibly intuitive and flexible, however it did make certain types of setups difficult to manage, or certain effects impossible altogether. With the introduction of Nodal shading, users can control nearly any surface attribute on a per sample basis, using a variety of driving influences, producing effects that were simply not possible in earlier versions.

Nodal shading is named so because it uses a network of 'nodes', simple visual representations of a specific function. These functions could be representative of an item and its channels, a mathematical operation or even some type of instruction to evaluate data a certain way. These various nodes are then linked together creating a network that defines the flow of information and controls how it is evaluated, the resulting network is called a graph.

Working in this way provides a sort of visual programming methodology for creating the shading instructions, where each node applies its contribution and then passes on the information to the next node. The flow of information through the network is left to right, where the left side link connections provide inputs for the information, which is evaluated and then returned to the right side connections to produce the output. Once a network is set up and assigned to a surface, the associated graph is evaluated at render time to produce the final shaded results.

Tip icon

TIP: The Schematic Viewport, used most often for rigging and particles, is the control interface where the shading graphs are defined. It is important to understand first that nodal shading is not a replacement for the Shader Tree, which is still a requirement to apply the shading to the actual surfaces for rendering. Each graph must contain at least one Shader Tree specific item. So a basic workflow when defining nodal shading would be- adding an item to the Shader Tree (placed into the appropriate target Material Group) and then that texture layer is added to the Schematic viewport for further network development.

Graph Building Basics

Working on a node graph is made more efficient by having multiple viewports available at once. Users can easily navigate between the Shader Tree, the Schematic viewport and the Channels list within the default 'Render' workspace layout. It is accessible in the menu bar under "Layout > Layouts > Render" (or simply the 'Render' tab, in the tabbed workspace). The Schematic panel, not visible by default, is located in the tabbed viewport group directly under the Preview window, by selecting the 'Schematic' specific tab.

Any network graph needs, at minimum, two nodes. Since it is necessary to have at least one Shader Tree specific item in a node network, it is often easiest to start any new shading graph by adding the initial item there. If you are not familiar with the Shader Tree, it is highly recommended to read the 'Shading' page of the documentation covering its use. This explains the adding of items to the tree and setting its 'Effect'. Once the item is added (and if necessary, positioned appropriately in the hierarchy), the item can then be placed into the Schematic viewport. This is done a couple of ways, either by drag and drop; LMB+clicking the target layer in the Shader Tree, and while holding the mouse button down, dragging the item over to the Schematic viewport where the mouse button is released, dropping the item into the viewport. Or by simply selecting the item layer in the Shader Tree and using the 'Add Selected' button found in the Schematic viewport.

Additional nodes can then be added directly in the Schematic viewport using its 'Add' button. LMB+clicking it opens a popup menu where all the possible nodes are located, though users will be mostly be sticking to the 'Channel Modifiers', 'Shading Inputs' and 'Shader Nodes' menu options when working with Nodal Shading. Selecting any item in the menu will add it to the Schematic viewport. The resulting node can be repositioned by LMB+clicking and dragging on the header of the node to the new location, and releasing the mouse button. It is easiest to see the flow of the data working left to right, so when adding nodes in the Schematic view, it is best to arrange them in this order, with the final destination node positioned on the furthest right hand side of the viewport.

A newly added node will come in with either its common channels intact, or it might come in with no channels at all, depending on the item. Channels are the actual operators in the Node graph, and which ones used are dependent on the desired outcome. When a specific channel is required, it can be added to a node by first selecting the target node in the Schematic, then selecting one or more of its related channels in the 'Channels' viewport. Using the same drag-and-drop action or 'Add Selected' method outlined above will add the channel(s) to Schematic, attaching them to their associated item.

The final step in creating a node graph is the connecting of the channels. This represents the actual data flow between items. There are two types of basic connections, an input or an output. Some channels will have only one or the other, and others will have both. Channels are connected from the right side of the node, the output, into the left side of another node, the input. The channel connection are designated by the small circle on the sides of the node. LMB+click and drag will produce a noodle, a line drawn in the viewport that visually represents the connection, dragging the noodle from an output to an input (or vice versa) and releasing the mouse button defines the actual connection, fixing the line between the channels. Even if the node is moved, the lines will adjust ensuring the connection representation is retained.

Node Graph Basics 1
Node Graph Basics 2
Tip icon

IMPORTANT: This is the way a basic node graph is built, adding nodes, adding channels where necessary, and then making connections between those channels. There are also various rules governing the connections of different channel types that can be very helpful to understand when building up complex graphs. The full details of working with Items and Channels in the Schematic viewport are covered in the Schematic Viewport specific page of the documentation.

Nodal Shading Basics

Knowing how to connect a graph is the easy part, but doesn't do much good if there is no knowledge of the underlying architecture. At its most basic level Nodal Shading is all about driving values on a per-sample basis. To understand that better, lets break it up into its two parts, first there is "driving values". A value is simply a number, but what is being driven? Each item in the Shader Tree has a number of attributes, these are the settings that appear in the 'Properties' panel for each item when selected. So for a 'Material' item, this would be things like 'Diffuse Color', or the 'Reflection Amount' controls. Each of these controls is actually a channel on the item, where a 'channel' is simply any attribute that can be animated, or in the case of Nodal Shading, controlled.

In a schematic context, taking the RGB color output of one node and connecting it in to the RGB color input of another, say the Materials 'Diffuse Color' channel, that incoming value now is driving the channel it is connected to, so really driven is just another word for controlling. The color defined in the Material setting itself no longer applies; its values are being overwritten by those of the incoming connection. So basically, any channel that is connected by its input is being driven by the incoming value. Driven channels are signified in the Channels viewport by the small gear icon with an arrow.

The second part is 'per sample'. What makes up a sample? When rendering an image, if we focus on just a single pixel for now, this one pixel is made up from many multiples of samples to arrive at the final value. For example, a single ray trace operation will fire a ray from the camera out into the scene in a straight line. If the ray hits a surface, at that location in 3D space the hit surface is sampled to find out what it looks like, answering questions like what is the surfaces color, is it shiny, reflective, is it in shadow? All of these different possibilities are individual samples. Nodal Shading gives users access to the sample engine at this sub-pixel level.

Normally these samples are all derived directly from settings defined in the Shader Tree, but with Nodal Shading things get really interesting because users can utilize the information from those samples directly, modify their results mid-stream, and then apply those results to different attributes altogether. The samples can be from a number of sources, and this is where the Shader Inputs come in to play. Shader Inputs are information collecting nodes, outputting the results of the various samples taken. Each allows users to collect specific information about the scene and use what is collected to control something else.

The Illuminate node evaluates if light is shining on a surface and how much, the Ray Cast node allows users to create sampling rays that collect information about surfaces the rays interact with. The Ray Type node separates shading information based on the actual type of ray used to compute it, and the Shader Inputs provide the actual information about anything that is being shaded, whether it is a surface, a particle, a volumetric or a texture. Each is covered more fully on its own documentation page.

Nodal shading doesn't have to be about complex graphs, or rays or samples. Sometimes simple operations are all that are required. In the Shader Tree alone, users are limited to the available 'Effect' settings that can be assigned for each layer. If every possible permutation of effect were available, the resulting list would be impossible to manage. Much more control is available with Nodal Shading. It is easy to, for example, modulate a grids 'Line Width' with a texture, or even with the surfaces angle of incidence, or amount of illumination. Driving values on a per sample basis is a fairly simple concept, but also incredibly powerful when used to its fullest potential.

Building a Procedural Texture



back next