You are here: Shading and Lighting > Shader Tree Item Layers > Processing > Gradient

Gradient

Gradient Sample

The Gradient texture layer is an incredibly powerful asset in the shading arsenal. Gradients provide a method for creating parametric materials. Put simply, gradients remap colors or value-based input parameters you define, and produce an output based on the values in the gradient itself. For instance, with a gradient texture you can tell a surface to ramp from purple to light blue based on the incidence angle to the camera or purple to green based on the slope of the surface. You can even control the number of clones in a Replicator based on height and angle of a surface. Gradients are also useful in controlling the color of fur and Replicators. The following samples help provide more information about a particular gradient's use.

Gradients are added to the Shader Tree where the effect it has on the surface is indicated, such as transparency or diffuse color. Next, you need to select the Input Parameter on the gradient texture's Properties panel, this defines how the gradient modulates the surface it is affecting. By clicking the Edit Gradient checkbox, you can open the Gradient Editor, where the actual gradient is defined. Its usage is covered below. For additional information on adding and using layers, see the Shader Tree topic.

Gradient Panel

Option

Description

Layer

Enable

Toggles the effect of the layer on and off to duplicate the functionality of toggling visibility in the Shader Tree. When disabled, the layer has no effect on the shading of the scene. However, Modo saves disabled layers with the scene, and they are persistent across Modo sessions.

Invert

Inverts the colors (RGB values) for the layer to produce a photonegative effect.

Blend Mode

Affects the blending between different layers of the same effect type. With this, you can stack several layers for different effects.

For more about blending, see the Layer Blend Modes topic.

Opacity

Changes the transparency of the current layer. Reducing this value increasingly reveals lower layers in the Shader Tree, if present, or dims the effect of the layer, itself, on the surface.

Locator

Gradient layers always have an associated Texture Locator that is automatically created in the Items list. While they typically define the mapping of the texture (way the texture is applied) to the surface, for gradients, the mapping is largely defined by the Input Parameter options. For gradients, the locator option is necessary to select the appropriate locator that controls certain input parameter effects, such as Distance to Locator and Locator Incidence. Within the texture locator options, you can also specify UV maps and other useful options for other parameters.

Surface Gradient

Input Parameters

The input parameters define the way in which the gradient is applied to its target. There are many different input parameters types to select from, organized by category. Demonstrated further below, you can select from any of the various categories to see the rendered examples. For the various Inout Parameter types, see Input Samples.

Edit Gradient

Opens the Gradient Editor. User can create the gradient in this viewport or refine a gradient from the mini gradient editors.

Value/Color

The Value and Color mini gradient editors allow you to quickly define basic gradients directly within the main interface. Which one to use depends on what effect is selected for the gradient item. The Value input is a black and white or grayscale type texture and used for effects that typically look for a percentage amount. The Color input is desirable for effects that look for RGB values such as where an image map might be used. The gradient values are defined by keys, like keyframes in a Timeline, gradient keys define specific values at a defined location and then smoothly attenuate the values between the keys. Keys are defined by middle-clicking within the mini-gradient editor, or on a Mac, by Ctrl+Alt+clicking. Defined keys can be edited by clicking and dragging the points up and down or left and right. Below the gradient key window is a graduated bar that represents the gradient itself. The window is limited to the 0%-100% range on either axis. For further refinement, you can edit the gradient in the full-sized Gradient Editor.

Gradient Editor

Gradient Editor Window

The Gradient Editor is where you can define the gradient values. Though visually and functionally similar to the Graph Editor, the Gradient Editor assigns values over a range instead of over time as the Graph Editor does. Mostly, you need to edit the R,G & B color, Alpha and Value channels. Modifying any other attributes reverts the bar to a Timeline where values are modified over time.

The window itself is divided into several sections. Across the top are the numeric input text fields followed by key controllers. These allow you to apply specific values to a key, as well as control the slope of incoming and outgoing curve handles. The left side of the window displays the channels available for editing. Modo generally selects the appropriate channel based on the layer's effect setting, but you can select Value or RGB Colors based on the layer's intended use. The center window is where you define the keys and modify their positions. New keys are added by middle-clicking in the graph area at the position where the key should be created, or with Ctrl+Alt+clicking on a Mac.

Once set, you can modify the key by clicking in the color palette on the right side. Positions of keys can be modified interactively by clicking on the individual handle bases (the white dots along the curves) and dragging them around in the viewport. Key positions can also be modified by dragging the handles that appear in the gradient bar below the graph area. This video explains the basic functionality of the Gradient Editor.

Channels: From within the channel section, you can select the value you wish to modulate. For diffuse color this is the Color R,G and B channels, for specular amount, this is the Value channel. Once selected, a line representing the value appears in the graphing window.

Setting Keys: Keys can be added to the currently selected curve(s) by middle-clicking either on the curve itself or anywhere on the graph area background.

Setting Colors for Keys: The color of selected keys can be set or adjusted by selecting the color key and either clicking and dragging on the Color Picker viewport or from the right-click context menu. Selecting Key Color from this menu opens the Color Picker from which you can select a color. In both cases additional keys can be created on associated curves at the key Input value.

Deleting Keys: Keys can be deleted from curves in two ways, to delete only the currently selected keys press the Delete key. To delete the currently selected keys and keys at the same Input value on associated curves, select Delete Key from the right-click context menu.

Selection: Clicking selects a key under the cursor, holding the Shift key while selecting adds to the selection, and holding Ctrl removes a key from the selection set. Clicking on the background deselects all keys.

Click and drag on the background starts box selection, drag out a box to enclose the keys you want to select and release the mouse button. All keys within the box become selected, any outside the box are deselected. Holding Shift adds the keys within the box to the selection, while Ctrl removes them.

Click on a curve in the background (dimmed) to select the curve. Curves can be added to the selection by holding Shift and clicking on a curve and can be removed from the selection with the Ctrl key.

Curves may also be selected from the menu at the top left of the viewport, this menu lists all the curves associated with the currently selected gradient item(s).

Editing: Click and drag on a key selects the key if it's not already selected and allows quick editing of both input and output values at the same time. If there are several keys already selected and you click and drag one of them, all the selected keys are modified. Middle-click and drag on a key works in a similar way except that editing is constrained to the Output value. Similarly, right-click and drag constrains the edits just to the Input Parameter value.

Middle-clicking and dragging vertically on the background adjusts the Output value of all selected keys. Right-clicking and dragging horizontally on the background adjusts the Input value of all selected keys.

Ctrl+middle-clicking and dragging on the background provides constrained editing of Input and Output values for selected keys based on the initial direction of movement.

Double-clicking on a key selects all the keys on the curve.

Context Menu : You can open the Gradient Editor context menu by right-clicking on the editor. If the cursor is over a key that is not selected, when the menu is opened the key is added to the selection. Operations performed from the context menu affect all the currently selected keys.

Navigation: Panning and zooming behavior in the Gradient Editor is similar to the 3D Viewports with a few additions.

Alt+middle-click and drag adjusts the start value of the Input (horizontal) range displayed in the editor, while Alt+right-click and drag adjusts the end value of the Input Range.

Alt+Shift+middle-click zooms the Output Range displayed in the editor, while Alt+Shift+right-click zooms the Input Range. In both cases the zoom is centered on the initial cursor location.

Alt+Ctrl+right-click provides box zooming.

The mouse wheel zooms in and out around the cursor location.