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
| Socket | Type | Wiring |
|---|---|---|
| mesh | geometry |
Parameters
| Name | Type | Default | Available when | What it does |
|---|---|---|---|---|
| Sampling | vertex | face | vertex | always | Vertex 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. |
| Output | vertex | texture | vertex | always | Vertex 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. |
| Factor | number | 0 | always | |
| Stops | number | 4 | always | |
| Color 1 | color | #1a1a2e | always | |
| Pos 1 | number | 0 | always | |
| Color 2 | color | #e94822 | always | |
| Pos 2 | number | 0.33 | always | |
| Color 3 | color | #f2a03d | always | |
| Pos 3 | number | 0.66 | always | |
| Color 4 | color | #fdf5c9 | always | |
| Pos 4 | number | 1 | always | |
| Color 5 | color | #ffffff | Stops is 5 or more | |
| Pos 5 | number | 1 | Stops is 5 or more | |
| Color 6 | color | #ffffff | Stops is 6 or more | |
| Pos 6 | number | 1 | Stops is 6 or more | |
| Color 7 | color | #ffffff | Stops is 7 or more | |
| Pos 7 | number | 1 | Stops is 7 or more | |
| Color 8 | color | #ffffff | Stops is 8 or more | |
| Pos 8 | number | 1 | Stops 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
- Flat colours on a rough surfaceHow-to
- Materials and appearanceHow-to
- My colour came out flatFix
- Select parts of a meshHow-to
- Vary copiesHow-to
- What counts as one faceHow-to
- Colour That Follows the Shapeteaches this
- A Selection Can Be a Strengthteaches this
- demo-topo-benchdemoContour bands read off height, with the ramp in Constant mode so each band stays a flat colour.
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.