PxrRamp

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.

images/pxrRamp/pxrRampType0.png

S Ramp (0)

images/pxrRamp/pxrRampType1.png

T Ramp (1)

images/pxrRamp/pxrRampType2.png

Diagonal (2)

images/pxrRamp/pxrRampType3.png

Radial (3)

images/pxrRamp/pxrRampType4.png

Circular (4)

images/pxrRamp/pxrRampType5.png

Box (5)

images/pxrRamp/pxrRampType6.png

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.

images/pxrRamp/pxrRampBasis0.png

Bezier (0)

images/pxrRamp/pxrRampBasis1.png

B-Spline (1)

images/pxrRamp/pxrRampBasis2.png

Hermite (2)

images/pxrRamp/pxrRampBasis3.png

Linear (3)

images/pxrRamp/pxrRampBasis4.png

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.

images/pxrRamp/pxrRampSplineMap.png
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.