Go to: Related nodes. Attributes.

The Ramp texture creates a texture map that graduates from one color to another through a series of colors.

You can easily create effects ranging from simple stripes to geometric patterns and mottled surfaces are easily created by the choice of Ramp and Interpolation types. By default, the Ramp texture graduates from red to green to blue in a linear, horizontal (V ramp) fashion. When applied as a bump map, the colors in a ramp appear as a gray scale based on the luminance of each color. Aside from the attributes listed here, Ramp inherits many other attributes from its parent node, Texture2d. In the table below, important attributes are shown in bold in the description column.

This node is MP safe

Node name Parents Classification MFn type Compatible function sets
ramp texture2d texture/2d kRamp kBase
kNamedObject
kDependencyNode
kTexture2d
kRamp

Related nodes

layeredTexture, envCube, envSphere, envSky, envBall, envChrome, bump3d, uvChooser, bump2d, texture2d, file, cloth, water, stencil, checker, fractal, bulge, grid, mountain, texture3d, projection, cloud, granite, crater, leather, stucco, brownian, solidFractal, marble, wood, rock, snow, defaultTextureList, place2dTexture, place3dTexture

Attributes (18)

color, colorB, colorEntryList, colorG, colorR, hueNoise, hueNoiseFreq, interpolation, noise, noiseFreq, position, satNoise, satNoiseFreq, type, uWave, vWave, valNoise, valNoiseFreq

Long name (short name) Type Default Flags
type (t) enum V_RAMP outputinputconnectablestorable
Controls what kind of ramp you are creating. The available types are:
  • U Ramp: colors change along the "U" direction of the texture.
  • V Ramp: colors change along the "V" direction of the texture.
  • Diagonal Ramp: colors change diagonally across the "U" and "V" directions.
  • Radial Ramp: colors change along a circular path, centered in the middle of the texture.
  • Circular Ramp: colors change along a straight line starting from s single point, forming a series of concentric circles.
  • Box Ramp: colors change along a straight line starting from a single point, forming a series of concentric squares or rectangles.
  • UV Ramp: colors change along both the "U" and the "V" directions.
  • Four Corner Ramp: the colors from the ramp are placed sequentially around the four corners of the texture, and the middle of the texture is interpolated between those colors. (if there are less than four colors in the ramp, black is used in the remaining corners.)
  • Tartan Ramp: the colors are interpolated in bands along both the "U" and the "V" directions, and blended where they cross each other, forming a plaid-like pattern.
interpolation (in) enum LINEAR_INTERP outputinputconnectablestorable
Controls the way the intermediate colors are calculated. In the formulas below, u is the interpolant between the indices, ranging between 0 and 1; blend is the value used for blending the left and right values.
Interpolation can be any of:
  • None: No interpolation is done; the different colors just show up as constant bands in the final texture.
    blend = 0
  • Linear: The values are interpolated linearly in RGB color space.
    blend = u
  • Exponential Up: The values are interpolated exponentially from the bottom to the top of the ramp. This means that each color dominates the space between it and the next color.
    blend = u*u
  • Exponential Down: The values are interpolated exponentially from the top to the bottom of the ramp. This means that each color dominates the space between it and the previous color.
    blend = 1 - (1-u)*(1-u)
  • Smooth: The values are interpolated along a bell curve, so that each color on the ramp dominates the region around it, then blends quickly to the next color.
    blend = 0.5 * (cos( (u+1)*PI) + 1)
  • Bump: The values are interpolated along a sin curve, based on the luminosity values. If L1 and L2 are the luminosity of the current and next color, then:
    blend = sin( u * PI/2) if L1 > L2
    blend = sin( (u-1) * PI/2 ) + 1 otherwise
  • Spike: Each color in the ramp dominates only its very immediate neighborhood, falling off very quickly. If L1 and L2 are the luminosity of the current and next color, then:
    blend = sin( u * PI/2) if L1 < L2
    blend = sin( (u-1) * PI/2 ) + 1 otherwise
colorEntryList (cel) compound n/a arrayoutputinputconnectablestorable
List of colors that comprise the ramp.
position (ep) float 0.0 outputinputconnectablestorable
List of locations, one for each color in the ramp, giving its position.
color (ec) float3 1.0, 0.0, 0.0 outputinputconnectablestorable
The current entry
colorR (ecr) float 0.0 outputinputconnectablestorable
The red component of the color entry
colorG (ecg) float 0.0 outputinputconnectablestorable
The green component of the color entry
colorB (ecb) float 0.0 outputinputconnectablestorable
The blue component of the color entry
uWave (uw) float 0.0 outputinputconnectablestorable
Controls the amplitude of sine wave offset in the texture in the "U" direction. For example, if you increase the value of U Wave, a linear interpolation pattern takes on a wavy appearance. If you want more waves, increase the texture's Repeat value in the Surface Placement window.
vWave (vw) float 0.0 outputinputconnectablestorable
Controls the amplitude of sine wave offset in the texture in the "V" direction. For example, if you increase the value of V Wave, a linear interpolation pattern takes on a wavy appearance. If you want more waves, increase the texture's Repeat value in the Surface Placement window.
noise (n) float 0.0 outputinputconnectablestorable
Affects the amount that the texture is offset in the "U" and "V" directions by two-dimensional noise.
noiseFreq (nf) float 0.5 outputinputconnectablestorable
Controls how fine-grained the noise is. Increase this to make the noise detail finer.
hueNoise (hn) float 0.0 outputinputconnectablestorable
Adds randomness to the hue of the colors in the ramp, resulting in mottled colors. Use higher values to produce psychedelic effects.
satNoise (sn) float 0.0 outputinputconnectablestorable
Adds randomness to the saturation of the colors. Increase this to add random areas of fading to the texture, simulating wear.
valNoise (vn) float 0.0 outputinputconnectablestorable
Adds randomness to the brightness of the colors. Increase this to add randome areas of darkness to bright textures, perhaps simulating dirt.
hueNoiseFreq (hnf) float 0.5 outputinputconnectablestorable
Controls the coarseness of the mottling caused by Hue Noise. Increase this value to make the mottling finer and more detailed.
satNoiseFreq (snf) float 0.5 outputinputconnectablestorable
Controls the coarseness of the mottling caused by Sat Noise. Increase this value to make the mottling finer and more detailed.
valNoiseFreq (vnf) float 0.5 outputinputconnectablestorable
Controls the coarseness of the mottling caused by Val Noise. Increase this value to make the mottling finer and more detailed.