Metlivi Studio

Pass Each Geometry Nodes Instance’s Position to a Blender Shader

To give each Geometry Nodes instance a shader value based on its location, connect Position to a Store Named Attribute node set to Vector and the Instance domain. In the material, read the same name with an Attribute node set to Instancer, using its Vector output. On the instance domain, Blender’s Position node returns each instance’s origin. Position Node — Blender Manual

This workflow is for a Blender user whose repeated objects display identical procedural patterns but should receive different colors according to their placement. The example below builds five small blocks with one uniform color per block, progressing from blue to orange along a row. Node names and settings follow the Blender 4.5 LTS manual.

Why do Object coordinates repeat across instances?

A texture coordinate describes where a shader samples a texture. An instance position describes where a repeated piece of geometry is placed. Those values serve different purposes: a surface pattern can repeat on every copy while each copy occupies a different location.

Blender’s Texture Coordinate node provides several coordinate systems. Generated coordinates span the undeformed mesh’s bounding box, while Object coordinates use an object as their coordinate source. Neither output explicitly supplies the named, per-instance origin used in this tutorial. The node’s From Instancer checkbox also does not change its Object output; the manual limits that option to Generated and UV. Texture Coordinate Node — Blender Manual

Choose the visible result first. For a miniature block that should be entirely blue or entirely orange, sample one position per instance. For a pattern that varies across the block’s surface, keep a surface coordinate as an additional input. Passing the instance origin gives you a placement-based control without replacing every other coordinate in the material.

Where should you store the position?

For the simplest setup, store it immediately after Instance on Points, after any instance movement that should affect the color. Connect Position directly to the storage node’s Value input. Its evaluation context comes from the receiving node’s domain: selecting Instance makes it evaluate once per instance. Blender documents this distinction explicitly, including the different local coordinates returned when Position is evaluated inside instanced geometry. Position Node — Blender Manual

Use these settings:

Store Named Attribute setting Value
Data Type Vector
Domain Instance
Name instance_origin
Selection Enabled for all instances
Value Position output

The name is the connection between the two editors. Store Named Attribute evaluates a field and saves its result under that name on the selected domain. Its geometry output must remain connected to the geometry reaching Group Output; placing an unconnected storage node beside the main chain does not carry the attribute into the result. Store Named Attribute Node — Blender Manual

There is also a useful earlier storage option. Store Position on the source points with the Point domain before Instance on Points. Blender makes attributes from those input points available on the generated instance domain. Choose this arrangement when you want the original distribution position to remain the shader reference even after you move the instances later. Instance on Points Node — Blender Manual

How do you build a five-block test scene?

Start with a mesh object at the scene origin, with zero rotation and unit scale, and add a Geometry Nodes modifier. Create a material named Placement Color; its shader will be configured in the next section. The test uses generated geometry, so the host object’s original mesh does not need to feed the output.

  1. Add a Mesh Line node in Offset mode. Set Count to 5, Start Location to (0, 0, 0), and Offset to (2, 0, 0).
  2. Connect its mesh output to the Points input of Instance on Points.
  3. Add a Cube primitive with Size set to (1, 1, 1).
  4. Connect the cube through Set Material, choosing Placement Color, and connect that result to the Instance input of Instance on Points.
  5. Connect the instance output through Store Named Attribute, using the settings above, and then to Group Output.
  6. Connect a Position node to the storage node’s Value input. Leave instance rotation at zero and scale at one.

The two geometry branches meet at Instance on Points: the line supplies placement points, and the cube supplies the repeated shape. Mesh Line’s documented Offset controls the distance and direction between successive vertices, so these illustrative settings place the five origins at X values 0, 2, 4, 6, and 8. Mesh Line Node — Blender Manual

Assigning the material to the cube before instancing makes the material assignment explicit. Set Material changes the material assignment on its input geometry. Set Material Node — Blender Manual

How does the material read and display the position?

Open Placement Color in the Shader Editor and add an Attribute node. Set its attribute type to Instancer and enter instance_origin exactly. Use the Vector output because the stored value contains X, Y, and Z. Blender’s shader Attribute node searches Geometry Nodes instance attributes when configured as Instancer. Attribute Node — Blender Manual

Build this shader chain:

  1. Connect Attribute: Vector to Separate XYZ.
  2. Connect X to a Map Range node’s Value.
  3. Set From Min to 0, From Max to 8, To Min to 0, and To Max to 1. Enable clamping.
  4. Connect the result to a Color Ramp factor. Use blue at position 0 and orange at position 1, with Linear interpolation.
  5. Connect the ramp’s color to an Emission shader’s color, set strength to 1, and connect Emission to Material Output: Surface.

Emission is useful here as a diagnostic material because the intended color differences are easy to inspect without interpreting surface lighting. Once the test works, connect the ramp to your production material’s desired color input.

For this example, the mapping is t = x / 8:

Block origin X Ramp factor Intended appearance
0 0.00 Blue endpoint
2 0.25 Intermediate color
4 0.50 Midpoint color
6 0.75 Intermediate color
8 1.00 Orange endpoint

These are calculated expectations for the proposed scene, not reported render measurements. Judge the sequence and uniformity first; display settings can affect how the colors appear on screen.

What changes if you realize the instances?

If another operation requires real mesh geometry, insert Realize Instances after Store Named Attribute. Then change the shader Attribute node’s type from Instancer to Geometry, keeping the name instance_origin. Geometry lookup reads attributes attached to the resulting geometry. Attribute Node — Blender Manual

The order matters. Blender propagates named and anonymous attributes from instances onto realized geometry. Saving the origin before realization therefore preserves the per-instance value. By comparison, evaluating Position on the realized mesh’s point domain produces mesh-point locations, which can create variation across each block. If the source mesh already has an attribute with the same name, its values take precedence over the instance attribute during realization. Use a distinctive name to avoid that collision. Realize Instances Node — Blender Manual

Keep live instances when material variation is your only requirement. Realization can substantially increase processing costs for many copies of complex geometry; the manual identifies this as a consequence of converting shared instances into real geometry. Realize Instances Node — Blender Manual

How do you check that the shader receives the intended value?

View the row in Material Preview or rendered shading. The expected result is five distinct, internally uniform colors in spatial order. A smooth gradient across each individual block indicates that your material is receiving a surface-varying coordinate somewhere in the chain.

Perform two deliberate edits. First, change Mesh Line’s X offset from 2 to 1. With Map Range still spanning 0 to 8, the last block now samples factor 0.5 instead of 1. This checks that color follows position rather than merely the order of the copies.

Second, insert a Transform Geometry node with translation (2, 0, 0) immediately before the storage node, then move it immediately after the storage node. Before storage, the new locations should be sampled; after storage, the saved values should remain those sampled earlier. Transform Geometry applies translation in the modified object’s local space. Transform Geometry Node — Blender Manual

Treat instance_origin as a snapshot in the Geometry Nodes evaluation space, not an automatic world-coordinate channel. For this setup, moving the host object in Object Mode does not constitute resampling a new local distribution. If your artistic goal is a color arrangement attached to the whole procedural object, that behavior is useful.

What should you check when every instance still looks identical?

Work through the data path before adding more texture nodes:

For nested setups, first reproduce the result with a single instance layer. The documented shader lookup searches from inner layers outward and is limited to four Geometry Nodes instancing layers. Reusing the same attribute name at several levels can therefore make the source of a value harder to identify. Attribute Node — Blender Manual

Once the five-block test behaves as expected, replace the cubes with your intended geometry and adjust the mapping range to its distribution. Keep the three decisions explicit: which position you sample, when you store it, and whether the shader reads live-instance or realized-geometry attributes. Those choices let each repeated object receive a placement-based color while its surface textures remain independently controllable.

Sources