Gradient Mixer

 
 
 

| RGBA Gradient | Alpha Gradient | Input | Render Tree Usage

Category: Processing > Mixers

Shader Family: Texture

Output: Color

The gradient mixer shader accepts a scalar or vector input that drives the color gradient that it outputs. This allows you to create gradients based on, for example, distance, vector coordinates, or incidence.

Name

The shader's name. Enter any name you like, or leave the default.

RGBA Gradient

Gradient Control

The gradient slider is where you create and adjust the gradient. The bar displays the gradient left-to-right from beginning (0.00) to end (1.00).

Square markers on the bottom of the gradient bar are color markers. You can use up to 8 color markers, each with its own color. Clicking on the gradient bar inserts a color marker at the click-point. By default, the new marker assumes the color of that point in the gradient. To delete a color marker, right-click it and choose "delete marker" from the menu.

A round marker on the top of the gradient bar appears between each pair of color markers, indicating the mid-point in the blend between those two colors. Moving the round marker closer to either color marker causes less of that color, and more of the other, to appear in that "sub-gradient". The net effect is a sharper blend and a larger portion of the dominant color.

Color

Controls the R, G, B, and alpha values for the selected color marker.

Pos

Controls the position of markers on the gradient:

Color Markers: If a color marker is selected, the Pos value indicates its position, on a scale of 0.00-1.00, within the entire gradient.

Interpolation Markers: If an interpolation marker is selected, the Pos value indicates its position, on a scale of 0.00-1.00, between its associated pair of color markers.

Cubic/Linear

Switches between linear and cubic interpolation of the gradient. Cubic interpolation results in a smoother transition between gradient colors, while linear interpolation results in sharper transitions.

Animation

Key All

Adds a keyframes for the gradient's color and position parameters. One keyframe is added for each color and interpolation marker in the gradient.

Remove Keys

Removes any and all keyframes applied to the gradient's color and position parameters. Keyframes are removed from all markers.

Reset

Removes any and all keyframes applied to the gradient's color and position parameters, and resets these parameters to their default values.

Disconnect All

Disconnects any and all shaders that are attached to gradient shader parameters.

Gradient Type

Vertical: Creates a standard linear gradient that starts from the bottom of the texture projection object and gradiates to the top.

Horizontal: Creates a standard linear gradient that starts from the leftmost edge of the texture projection object and gradiates to the rightmost.

Radial Wave: Creates a gradient that begins at the center of the texture projection and gradiates outward, in a bull's-eye pattern.

Radial Rainbow: Creates a rainbow-like gradient that originates at the center of the texture projection, except this mode uses a linear, symetrical pattern.

Diagonal Down: Creates a standard linear gradient that starts from the bottom-left corner of the texture projection object and gradiates to the top-right corner.

Diagonal Up: Creates a standard linear gradient that starts from the top-left corner of the texture projection object and gradiates to the bottom-right corner.

Invert Direction

When enabled, the gradient colors are applied in the reverse order of how they appear in the gradient slider.

Clip

When enabled, the gradient ends at the edge of the outermost color. Otherwise the outermost color bleeds over the untextured portion of the object.

Preset

Black/White

Creates a 2-marker black to white gradient.

White/Black

Creates a 2-marker white to black gradient.

Black to Transparent

Creates a 2-marker black to black gradient with a descending alpha value.

White to Transparent

Creates a 2-marker white to white gradient with a descending alpha value.

Chrome

Creates a 4-marker gradient that simulates the look of chrome.

Copper

Creates a 4-marker gradient that simulates the look of copper.

Spectrum

Creates a 7-marker gradient that replicates the visible spectrum of colors.

Rainbow

Creates an 8-marker gradient that replicates the red to violet spectrum of a rainbow.

Fire

Creates a 6-marker gradient that simulates the colors of a flame, beginning with yellows and reds, blending into orange and ending with a blue. The alpha value gets progressively lower to give the edges of the flame translucence.

Alpha Gradient

Enable Alpha Gradient

Activates a gradient in the alpha channel of the output texture.

Gradient Control

The gradient slider is where you create and adjust the gradient. The bar displays the gradient left-to-right from beginning (0.00) to end (1.00).

Square markers on the bottom of the gradient bar are alpha markers. You can use up to 8 alpha markers, each with its own alpha value. Clicking on the gradient bar inserts an alpha marker at the click-point. By default, the new marker assumes the alpha of that point in the gradient. To delete an alpha marker, right-click it and choose "delete marker" from the menu.

A round marker on the top of the gradient bar appears between each pair of alpha markers, indicating the mid-point in the blend between those two alpha values. Moving the round marker closer to either alpha marker causes less of that alpha value, and more of the other, to appear in that "sub-gradient". The net effect is a sharper blend and a larger portion of the dominant alpha value.

Alpha

Controls the alpha value for the selected alpha marker on the gradient slider.

Pos

Controls the position of markers on the gradient:

Alpha Markers: If an alpha marker is selected, the Pos value indicates its position, on a scale of 0.00-1.00, within the entire gradient.

Round Markers: If a round marker is selected, the Pos value indicates its position, on a scale of 0.00-1.00, between its associated pair of alpha markers.

Cubic/Linear

Switches between linear and cubic interpolation of the gradient. Cubic interpolation results in a smoother transition between alpha values, while linear interpolation results in sharper transitions.

Animation

Key All

Adds a keyframes for the gradient's alpha and position parameters. One keyframe is added for each color and interpolation marker in the gradient.

Remove Keys

Removes any and all keyframes applied to the gradient's alpha and position parameters. Keyframes are removed from all markers.

Reset

Removes any and all keyframes applied to the gradient's alpha and position parameters, and resets these parameters to their default values.

Disconnect All

Disconnects any and all shaders that are attached to gradient shader parameters.

Gradient Type

Vertical: Creates a standard linear gradient that starts from the bottom of the texture projection object and gradiates to the top.

Horizontal: Creates a standard linear gradient that starts from the leftmost edge of the texture projection object and gradiates to the rightmost.

Radial Wave: Creates a gradient that begins at the center of the texture projection and gradiates outward, in a bull's-eye pattern.

Radial Rainbow: Creates a rainbow-like gradient that originates at the center of the texture projection, except this mode uses a linear, symetrical pattern.

Diagonal Down: Creates a standard linear gradient that starts from the bottom-left corner of the texture projection object and gradiates to the top-right corner.

Diagonal Up: Creates a standard linear gradient that starts from the top-left corner of the texture projection object and gradiates to the bottom-right corner.

Invert Direction

When enabled, the gradient alpha values are applied in the reverse order of how they appear in the gradient slider.

Clip

When enabled, the gradient ends at the edge of the outermost color. Otherwise the outermost color bleeds over the untextured portion of the object.

Preset

Black and White

Creates a 2-marker gradient that goes from full transparency (alpha=0) to full opacity (alpha=1).

White and Black

Creates a 2-marker gradient that goes from full opacity (alpha=1) to full transparency (alpha=0).

Input

Input Type

The shader can accept vector or scalar inputs:

Scalar: is used to make a gradient according to a scalar value like distance.

Vector: is used to make a gradient according to vector values, like texture coordinates. The 2D gradient can then be used to shade the surface of an object.

Vector X, Y, Z: is used to make a gradient according to an individual vector. This is useful for hair texturing where the U and V data contain information about the hair's position, intersection, and so on. I that case, you would need to connect a Vector State shader to the coordinate input.

Input

A scalar input designed to accept a scalar output, like distance, from another shader.

Coordinate Input

A vector input designed to accept vector data, like texture coordinates, from another shader.

Active Range Min/Max

Although the shader's input can have any range of values, the gradient shader's range is from 1 to 0. The active range minimum and maximum values remap the input's highest and lowest values to 1 and 0 respectively. Values in between are adjusted accordingly.

Render Tree Usage

This shader requires a scalar or color input from which to generate a gradient. Input shaders are connected to the shader's Input (scalar) or Coord (vector) ports. You can also texture the color/alpha and position parameters of the color and alpha gradients' markers, as well as the position of the interpolation markers. Connection textures to color markers' color parameter allows you to create a gradient of textures.

The gradient defined by the shader and its input can connected to nearly any parameter on any shader. For example, you could use a gradient to control a surface shader's transparency, reflection, or even basic surface shading. A common use of gradients is to drive the weight parameter in a mixer shader to control how colors or textures are blended together.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License