Metlivi Studio

How to Preserve Each Instance’s Initial Color in a Blender Geometry Nodes Simulation

Store each instance’s starting color as a named attribute before its geometry enters Simulation Input, then carry that geometry through the simulation without overwriting the attribute. In the instance material, read the saved color with an Attribute node set to Instancer.

This tutorial builds a small, inspectable example: three cubes start with different colors and move along the X axis while retaining those colors. The node names and behavior described here follow Blender’s 4.5 LTS manual. The same storage principle also applies when your simulation moves points and creates instances afterward.

Why does the color change when an instance moves?

A position-driven color field describes how to calculate color wherever it is evaluated. It does not automatically remember an earlier result. On the instance domain, Blender’s Position node returns each instance’s origin, so evaluating a position-based palette after movement can produce a different color. Position Node.

Simulation boundaries determine when initialization happens. Inputs connected to Simulation Input are evaluated at the beginning of the simulation. Other connections entering the zone from outside are reevaluated at each step. Consequently, connecting a color calculation directly to a storage node inside the update path can keep replacing the value you intended to preserve. Simulation Zone.

The practical distinction is between calculating an initial color and reading that stored color later. Your movement calculation may change every step; the saved color should remain untouched.

Build three cubes with visibly different starting colors

Add a Geometry Nodes modifier to a mesh object and create a new node group. For this example, replace the incoming object geometry with a generated line of three vertices. Add Mesh Line in Offset mode with these illustrative settings:

Input Value
Count 3
Start Location (-2, 0, 0)
Offset (2, 0, 0)

These settings place vertices at X positions −2, 0 and 2. In Offset mode, the offset controls the spacing and direction between successive vertices. Mesh Line Node.

Connect the line to the Points input of Instance on Points. Add a Cube primitive with size (0.6, 0.6, 0.6) as the source geometry. Pass that cube through Set Material before connecting it to the Instance input; create a material named Initial Palette for this purpose.

Build the starting palette with Position → Separate XYZ, using its X output as the value for a Map Range node. Map From Min = -2 and From Max = 2 to To Min = 0 and To Max = 1, with clamping enabled. Feed the result into a Color Ramp.

Give the ramp three stops: red at 0, teal at 0.5, and yellow at 1. These colors are an illustrative palette, so exact channel values are unnecessary. The important feature is that the three initial positions produce three easily distinguishable results.

Store the color on the instances before initialization

Place Store Named Attribute immediately after Instance on Points, before the simulation zone. Configure it as follows:

Setting Value
Data Type Color
Domain Instance
Name initial_color
Selection All instances
Value The Color Ramp color output

Connect the actual geometry through this node. A color connection alone does not place the saved value on the geometry traveling into the simulation. Store Named Attribute evaluates its value field and writes the result onto the selected domain of its geometry input. Store Named Attribute Node.

At this location, the position field is evaluated for the newly created instances, before they have moved. The geometry leaving the storage node therefore contains both the instances and their saved initial_color values.

Keep the attribute name specific and use it consistently. Blender can update an existing attribute’s domain and data type when another storage node uses the same name. Also leave Selection enabled for all three cubes: when a new attribute is created, unselected elements receive zero values. Store Named Attribute Node.

Move the saved instances through the simulation

Add a simulation zone. Connect the geometry output of Store Named Attribute to the external Geometry input of Simulation Input. Inside the zone, connect its geometry output through Translate Instances, then into Simulation Output. Connect the output geometry to Group Output.

The complete geometry route is:

  1. Mesh Line → Instance on Points.
  2. Instance on Points → Store Named Attribute.
  3. Store Named Attribute → Simulation Input.
  4. Inside the zone: Simulation Input → Translate Instances → Simulation Output.
  5. Simulation Output → Group Output.

For movement, use a Vector Math node set to Scale. Set its vector to (1, 0, 0) and connect Simulation Input’s Delta Time output to the scale input. Connect the resulting vector to Translate Instances → Translation. This expresses an illustrative speed of one Blender unit per second; Delta Time supplies the elapsed seconds for the simulation step. Simulation Zone.

Disable Local Space on Translate Instances so translation follows the modifier object’s axes, regardless of individual instance rotations. For an uncomplicated test, leave the modifier object’s transforms at their defaults. Translate Instances Node.

The update path now changes the instance transforms without recalculating their colors. Do not add another position-driven write to initial_color inside this path.

Read the saved attribute in the material

Open Initial Palette in the Shader Editor. Add the shader Attribute node, enter initial_color as its name, and change its attribute type to Instancer. Connect its Color output to the Base Color input of Principled BSDF, then connect the shader to Material Output.

The Instancer setting matters because this setup stores color on instance records. Blender’s shader attribute lookup checks Geometry Nodes instance attributes in this mode. Use Material Preview or Rendered shading to inspect the material result. Attribute Node.

Keep the shader connected to the saved attribute during this check. If another texture or position calculation supplies the final base color, the visible result no longer tests the stored value.

What changes if you realize the instances?

If your later operations require real mesh geometry, place Realize Instances after Simulation Output. Then change the material’s Attribute type to Geometry, because you are reading an attribute from the resulting geometry.

Blender propagates instance attributes to realized geometry. However, if the source cube already contains an attribute named initial_color, that base-geometry attribute takes precedence during realization. Use a unique name or remove the conflicting source attribute. Realization also increases processing and memory demands for complex repeated geometry, so it is unnecessary for this simple color-preservation task. Realize Instances Node.

Choose the storage domain that matches your simulation

Some node trees simulate point positions and create cubes only after the zone. In that arrangement, store initial_color on the Point domain before those points enter Simulation Input. Update the point geometry, then connect the simulation result to Instance on Points.

Attributes on the input points become available on the instance domain of the generated instances. This allows the same Instancer material lookup to work after instancing. Instance on Points Node.

Geometry carried through the zone Where to save color Material lookup at the end
Instances Instance domain before initialization Instancer
Points, instanced afterward Point domain before initialization Instancer
Instances, fully realized afterward Instance domain before initialization Geometry after realization

For a continuously emitting setup, initialize the attribute on the new geometry branch before joining it to the previous simulation state. Each incoming batch needs its own starting values. Writing a position-based color across the combined geometry every step would also recolor the older elements. This placement follows the same storage rule used in the three-cube example.

Check that color follows the cube rather than its location

Start at the simulation’s initial frame and play forward sequentially. Follow the initially red, leftmost cube. Once it has moved approximately two units, it occupies the teal cube’s original X position. It should still be red. This deliberately makes the test sensitive to accidental position-based recoloring.

Check the underlying data as well. Open the Spreadsheet editor, choose the object’s Evaluated state, and inspect the top-level instance domain. Look for the initial_color attribute and compare its values at two simulated frames. The editor supports inspecting evaluated geometry attributes, with rows representing elements such as instances. Spreadsheet.

For this fixed three-instance example, the saved color values should remain unchanged while the cubes move. This separates attribute preservation from changes in the rendered appearance.

Use the following sequence if the result differs:

  1. No saved color column: inspect the geometry connection through Store Named Attribute, its domain, and whether you are viewing the top-level instances.
  2. All cubes display black: check the exact name initial_color, the material assigned to the source cube, and the shader’s Instancer setting.
  3. Colors change during travel: find later writes to initial_color or a shader connection that bypasses the stored attribute.
  4. Colors change only after realization: check for a same-named attribute on the source mesh and switch the shader lookup to Geometry.

After changing initialization, return to the beginning and replay the simulation. Remove an existing bake before evaluating a revised setup; simulation playback uses cached state, so an earlier result can obscure your changes. Blender documents automatic playback caching and disk baking in its simulation workflow. Simulation Zone.

The intended result is straightforward to verify: each cube keeps its original palette entry as its position changes. Once that works, replace the three-stop ramp with your own starting-color calculation while keeping the same initialization point, geometry path, and material lookup.

Sources