Color mesh with per-vertex values in Blender 4.2 using Geometry Nodes

Following my banger of a post from 2022 lets revisit the same problem in 2026: now in Blender 4.2.3 (LTS).

Here I show a better way to solve the same problem: color mesh with per-vertex values, this time more interactive and with Geometry Nodes.

3D cow mesh rendered with color gradient from vertex attributes in Blender

Load values

Here is a simple script to populate named attribute with random values:

import bpy
import random

mesh = bpy.data.meshes["cow"]

attribute = mesh.attributes.new(name="eigenvector", type='FLOAT', domain='POINT')

for i in range(len(mesh.vertices)):
    attribute.data[i].value = random.uniform(0.0, 1.0)

Map values to color

The magic happens in Geometry nodes:

Blender Geometry Nodes setup showing Map Range and Color Ramp nodes for vertex coloring

Here we map vertex float attribute eigenvector to a vertex color attribute eigencolor.

  • We first normalize values to 0-1 with Map Range
    • Maximum node (comes in Utilities/Math) helps with mapping
  • Then value is mapped to color using Color Ramp
    • Color ramp can create any gradient, and you see the results immediately

Setup shader

The shader is very simple: use vertex color attribute eigencolor

Blender shader editor with vertex color attribute node connected to material output
By the way, this is a visualization of mesh Laplacian eigenvector. Again.

Done! Go have fun with the Color Ramp and see the results immediately.




    More Posts

    Here are some more articles you might like to read next:

  • Adobe ExtendScript
  • Debugging Ubuntu / Nvidia / CUDA / PyTorch relations
  • Render mesh with per-vertex color
  • πŸ‡ΊπŸ‡¦ Ukrainian scholars are welcomed in North America
  • Adversarial Art