How to Keep One Random Solid Color per Instance After Realize Instances in Blender
Store a random float on the Instance domain before Realize Instances, then read that named attribute in the material with an Attribute node set to Geometry. Use the float to drive a Color Ramp: each former instance keeps one color across its surface.
This tutorial is for a Blender Geometry Nodes user whose scattered objects lose their color variation when realized. The workflow uses Blender 4.5 LTS node names and a small grid of cubes as a reproducible example. It creates a new random assignment; it does not reproduce an earlier Object Info → Random pattern exactly.
Why does the color change after Realize Instances?
The shader’s Object Info node supplies a random number associated with an object instance. Realization converts instances into geometry, so relying on that shader output no longer preserves the original instance-by-instance assignment. That explains why a material that varied across instances can become uniform after realization. See Blender’s Object Info Node documentation and Realize Instances Node documentation.
The useful behavior is that Realize Instances transfers named attributes from instances onto their realized geometry. Store the choice while Blender still has an instance domain, then let realization carry it forward. Every part of a particular copy receives the same stored choice, provided the source geometry does not already contain a conflicting attribute name. Blender Manual: Realize Instances Node
Build a small scene with clearly separated copies
Start with a mesh object and create a Geometry Nodes modifier using New in the Geometry Nodes workspace. For this test, replace the default connection from Group Input to Group Output with generated geometry. Add a Grid, a Cube, and Instance on Points.
Use these illustrative settings:
| Node | Setting | Value |
|---|---|---|
Grid |
Size X / Size Y | 6 / 4 |
Grid |
Vertices X / Vertices Y | 4 / 3 |
Cube |
Size | (0.7, 0.7, 0.7) |
Instance on Points |
Selection | Enabled |
Instance on Points |
Pick Instances | Disabled |
Connect Grid: Mesh to Instance on Points: Points, and Cube: Mesh to Instance on Points: Instance. The grid provides 12 positions for 12 separated cubes. Instance on Points accepts mesh geometry with a point domain, so a separate mesh-to-points conversion is unnecessary here. Blender Manual: Instance on Points Node
The spacing makes the intended result easy to inspect: neighboring cubes can have different colors, while every face belonging to one cube shares the same base color.
Store one random value on each instance
Add Store Named Attribute immediately after Instance on Points. Set its data type to Float, its domain to Instance, and its name to instance_color_key. Leave Selection enabled for all instances. Add a Random Value node, choose Float, set Min to 0.0, Max to 1.0, and Seed to 7. Connect its Value output to the attribute node’s Value input.
The domain is the decisive setting. Store Named Attribute evaluates the connected field on the selected domain and saves the result under the specified name. Here, the field is evaluated once for each instance. Merely placing a Random Value node earlier on the canvas does not store anything; the geometry must pass through the storage node. Blender Manual: Store Named Attribute Node
Leave the random node’s ID input unconnected for this example. Its default uses the geometry’s id attribute when available and otherwise its index. Connecting the same constant ID for every instance would instead request the same random result for each one. Blender Manual: Random Value Node
Now add Realize Instances, followed by Set Material. Enable all selections and enable Realize All. The geometry path should read:
Instance on Points → Store Named Attribute → Realize Instances → Set Material → Group Output
Create a material named Instance Palette and select it in Set Material. Placing material assignment after realization makes the test straightforward because the node receives the resulting mesh faces. Set Material changes the material assignment on its selected geometry. Blender Manual: Set Material Node
Read the stored value in the material
Open Instance Palette in the Shader Editor. Add the shader Attribute node, set its attribute type to Geometry, and enter instance_color_key exactly. Add a Color Ramp, then make these connections:
Attribute: FactoColor Ramp: Fac.Color Ramp: ColortoPrincipled BSDF: Base Color.Principled BSDF: BSDFtoMaterial Output: Surface.
Use the shader Attribute node here, rather than Geometry Nodes’ Named Attribute node. The shader node retrieves attributes from the object or mesh; its Geometry mode reads geometry-associated values, and its factor output provides the scalar needed by the ramp. After realization, this is the appropriate location to read the transferred value. Blender Manual: Attribute Node
For an ordinary shaded result, set the Principled material’s Metallic to 0 and Roughness to about 0.6. These are suggested artistic settings. Inspect the result in Material Preview or Rendered viewport shading so you can assess the material.
Choose a fixed palette or a continuous color range
For a palette of teal, orange, and violet, set the ramp’s color mode to RGB and interpolation to Constant. Configure three stops at 0.0, approximately 0.3333, and approximately 0.6667. Replace or move the original end stop as needed so these are the three final positions. Constant interpolation keeps discrete color steps; ramp stop positions control where those steps occur. Blender Manual: Color Ramp Widget
As an illustrative mapping, stored values of 0.12, 0.48, and 0.86 would select teal, orange, and violet respectively. These values explain the palette logic; they are not reported outputs from seed 7. Approximately equal intervals give the colors similar opportunities to be selected, but a small grid need not contain equal counts.
If you want intermediate shades, choose Linear interpolation instead. Each cube still receives one solid base color because its ramp input is constant across that copy. Constant interpolation controls palette discreteness; storing on the Instance domain controls uniformity within each copy. The ramp’s interpolation options are described in the Color Ramp Widget documentation.
Check the result without confusing color and lighting
Use this practical inspection sequence before adding more geometry processing:
- Confirm that all 12 cubes are visible and separated.
- Inspect several cubes from more than one angle. Their faces should share a base hue, although lighting can change their brightness.
- Change only
Random Value: Seed. The distribution should change while each cube remains internally uniform. - Restore seed
7and confirm that the earlier assignment returns with the same unchanged input geometry.
For a clearer diagnostic view, temporarily connect the ramp’s color to an Emission shader’s color input, set strength to 1, and connect that shader to Material Output: Surface. This removes surface-lighting variation from the inspection. Restore the Principled connection afterward if you want shaded cubes. The purpose is to distinguish a changing attribute from ordinary highlights and shaded faces.
Changing the seed requests another random set. Keeping a seed fixed does not establish a permanent color identity if the IDs or indices driving the random node change. For an animated or reordered setup, inspect the identifier feeding ID as well as the seed. The dependency on ID and seed is documented in Blender’s Random Value Node reference.
Diagnose uniform colors, patchy faces, and nested groups
Use the visible symptom to choose your next check:
| Symptom | First check | Correction |
|---|---|---|
| Every cube has one identical color | Storage domain and random ID | Store on Instance; remove a shared constant ID |
| Different faces of one cube receive different hues | Where randomness is evaluated | Store before realization, rather than generating fresh random values per mesh element afterward |
| The material shows only the ramp’s first color | Attribute name, shader mode, and geometry path | Match instance_color_key, use Geometry, and ensure the storage node is connected |
| Only some copies receive useful values | Storage selection | Enable selection for every intended instance |
| An entire nested group shares a color | Which instance level receives the attribute | Store at the level corresponding to the visual unit you want colored |
Two documented details help resolve less obvious failures. First, unselected elements receive zero when Store Named Attribute creates a new attribute. Second, source-geometry attributes take precedence over instance attributes with the same name during realization. If your source mesh already contains instance_color_key, use a fresh name in both the storage node and material. Store Named Attribute Node, Realize Instances Node
For nested arrangements, decide what counts as one colored unit. To give every cube its own color, store the value on the cube instances. To give an entire arrangement one color, store it on the arrangement instances, avoiding a same-name attribute inside them. Realize All realizes every nested level, while Depth controls partial realization when Realize All is disabled. Blender Manual: Realize Instances Node
The finished result should have one consistent base color per former instance, with variation between copies and no face-by-face patches. Once the small grid passes that check, use the same storage and material connections in your larger setup. Keep the attribute name consistent and place storage at the instance level that matches the objects you want to color.
Sources
- Realize Instances Node — Blender 4.5 LTS Manual
- Instance on Points Node — Blender 4.5 LTS Manual
- Store Named Attribute Node — Blender 4.5 LTS Manual
- Random Value Node — Blender 4.5 LTS Manual
- Set Material Node — Blender 4.5 LTS Manual
- Attribute Node — Blender 4.5 LTS Manual
- Object Info Node — Blender 4.5 LTS Manual
- Color Ramp Widget — Blender 4.5 LTS Manual