PxrRamp

Creates a color ramp (gradient) that gradually transitions between colors specified in the colors input list.

The lists Colors and Positions must have the same number of elements. Together, they define the list of control points used for the spline interpolation.

At least four control points must always be given. Depending on the cubic spline basis function chosen (Spline Type), the following applies (n being the number of additional 'ramp color controls' from a user point of view):

• Linear: the number of control points must be 4+n. The first and last control points are unused but are nonetheless required to maintain consistency with the cubic bases.
• B-Spline and Catmull-Clark: the number of control points must be 4+n
• Hermite: the number of control points must be 4+2n
• Bezier: the number of control points must be 4+3n

Input Parameters

Ramp Type

Controls the direction in which the ramp colors change.

 S Ramp (0) T Ramp (1) Diagonal (2) Radial (3) Circular (4) Box (5) 4 Corner (6)
RIB: int rampType
Default: 0

Tile

Determines whether the ramp texture is repeated.

RIB: int tile
Default: 0

Positions

The list of positions for the colors on the ramp. The positions range between 0 and 1, which are the two endpoints on the ramp.

RIB: float[] positions
Default: [0.0]

Colors

The list of colors on the ramp. There is a color at each of the positions specified in the positions list.

RIB: color[] colors
Default: [ 0.0 0.0 0.0 ]

Reverse

If enabled, this flips the ramp so it reverses direction.

RIB: int reverse
Default: 0

Spline Type

Controls the way the intermediate colors between the colors listed in the colors list are calculated.

 Bezier (0) B-Spline (1) Hermite (2) Linear (3) Catmull-Rom (4)
RIB: int basis
Default: 4

Spline Map

If connected to a pattern, this is the 1D manifold that controls the map of the ramp. For example, if you connect this to a noise pattern, then the direction of the changing colors in the ramp will follow the noise pattern. This map takes precedence over the manifold value if both are connected.

The following image shows a PxrVoronoise pattern (with frequency set to 10) connected to a ramp through the splineMap parameter. The black values from the noise pattern are mapped to red from the ramp, and the white values from the noise are mapped to blue from the ramp, and the values between that are mapped to the green color from the middle of the ramp.

RIB: float splineMap
Default: 0.0

Manifold

Controls the 2D placement of the ramp. Defaults to using the s and t values of the surface geometry to place the ramp colors on the surface.

RIB: struct manifold

Output Parameters

resultRGB

The ramp color result.

resultR

The R channel from the resultRGB output.

resultG

The G channel from the resultRGB output.

resultB

The B channel from the resultRGB output.