# How to set texture correctly for realized instances?

I need to realize instances in order to apply later different set positions for each instance. But when realizing the instances, the texture does not behave correctly.

Here is what I did:

1. Geometry Nodes graph that creates instances of spheres, then realizes.

Here is an example of the geometry created from a plane object using this nodes graph:

For a sphere it should create the following look. The noise is spread nicely.

3. The Geometry Nodes graph with "Set Material", but with muted "Realize instances" node.

Without "Realize Instances" node, the texture works well on the spheres:

4. The Geometric Nodes graph with "Set Material" and "Realize instances" nodes.

Now the textures are incorrect, and I don't know why and how to solve this.

Would be happy for your help, Thanks!

Your stretch is caused by using the default coordinate system of the Noise Texture node, which is Generated - it's a normalized position, where the bounding box of the object is mapped to $$0…1$$ coordinates for each axis. Since your object's bounding box isn't equal on all axes - in quellenform's example it has dimensions 9, 9, 2, meaning the $$z$$ dimension is $$4.5$$ times smaller than either $$x$$ or $$y$$.

The simplest solution is then to use Texture Coordinate: Object instead:

The differences to quellenform's solution:

• q: each ball has same pattern; me: each ball has a different pattern
• q: as balls move, their patterns stay the same; me: the balls move through the pattern, so it depends on their position
• q: as you warp (modify) the geometry, the pattern again stays the same, like here, which may be what you want, but it will again produce a stretch of the pattern when (inevitably) you stretch the geometry; me: just like with moving the balls, the vertices will move through the pattern, so it won't be stretched, but this also means an animation won't feel like objects stretching, which could be what you want to achieve

If you want a combination of q and me behaviors, ask another question and probably we can help with that.

quellenform:

me: [I've set up for myself a more favorable lighting so that it looks better]

• +1 looks better to me ;) Commented Sep 18, 2023 at 10:05
• That's a very informative and helps! Q method keeps the texture while moving, and yours keeps the texture un-stretched when deformed. Commented Sep 18, 2023 at 12:02
• @audi02 you could combine the two by capturing the instance position and then offsetting (Vector Math: add) the texture coordinate by the captured position. Commented Sep 18, 2023 at 12:35
• @Markus von Broady, yes, I will try this. thanks! Commented Sep 18, 2023 at 13:27

In this case, since you have not assigned your own UV map to your UV sphere, the position of the points in the shader is used.

If you now instantiate several spheres at different positions and then realize these instances, of course these positions will also change.

A possible solution would therefore be to capture the positions in an attribute before instantiation, and to use this explicitly in the shader.

This could look something like this:

(Blender 3.6+)

• That's a good one, and it keeps the texture while moving! Commented Sep 18, 2023 at 12:00