DocsNodesModifiers

Color Ramp

Turns a number into a colour by looking it up on a gradient you define.

gradient, colour by height, color by height, palette, heatmap, contour bands
Category
Modifiers
Outputs
mesh
Runs live in
Godot, Roblox

Wire any field into Factor and Color Ramp reads it as a position along a gradient, from 0 at the first stop to 1 at the last. Height becomes altitude bands, noise becomes weathering, an index becomes a palette. The gradient itself is up to eight stops you place and colour. What the ramp writes depends on Output: vertex colours by default, or a small gradient texture with real coordinates, which is what you want when a single flat face should carry a whole sweep of colour rather than blending between its corners.

Inputs

SocketTypeWiring
meshgeometry

Parameters

NameTypeDefaultAvailable whenWhat it does
Samplingvertex | facevertexalwaysVertex blends the colour smoothly across each face, and Face gives the whole face one flat colour, which is the low-poly look. Face works out where the faces are by finding flat regions, so after anything that moves vertices around, put a Set Faces node in between to say what a face is again. If your flat colours start breaking into triangles, that is what happened.
Outputvertex | texturevertexalwaysVertex writes a colour at each corner and lets the surface blend between them. Texture bakes the gradient into a small image instead and gives the mesh coordinates to read it, so the colour varies smoothly across a face rather than only at its corners. On large flat faces that is a visible upgrade, and the coordinates travel with a glTF export.
Factornumber0always
Stopsnumber4always
Color 1color#1a1a2ealways
Pos 1number0always
Color 2color#e94822always
Pos 2number0.33always
Color 3color#f2a03dalways
Pos 3number0.66always
Color 4color#fdf5c9always
Pos 4number1always
Color 5color#ffffffStops is 5 or more
Pos 5number1Stops is 5 or more
Color 6color#ffffffStops is 6 or more
Pos 6number1Stops is 6 or more
Color 7color#ffffffStops is 7 or more
Pos 7number1Stops is 7 or more
Color 8color#ffffffStops is 8 or more
Pos 8number1Stops is 8 or more

8 of these 20 parameters only apply in some settings. The Available when column says which.

Watch out

Put Set Material after the ramp, not before. It keeps the colours the ramp wrote; the other order overwrites them.

Built with this node

See also

  • valueRampThe same curve with a number where the colour goes, for driving a size or an offset instead.
  • setMaterialGive the ramped mesh a material without losing the colours.

Open the editor and try it