Geometry Nodes - how to realize instances with material?

The problem is that when you realize the instances they are no longer different objects and will not give a random value per object (they just give one value which is the value of the object with the GN modifier)

You need to create a random value from 0-1 inside the GN modifier and output it to use in the shader editor to use as a factor for the colour ramp.
The way I found to do it was this:

What it does is I captured the index value of the points I used to instance the spheres, I fed that value into a random value node 0-1 and outputted the result. Then I used that attribute in the shader editor (I gave it the “name random0-1” in the output field).
Here is the file.

Index.blend (125.5 KB)

Edit:
I am not sure what the problem is with your last screenshot your UV map should work (as you are entering it as an attribute)
Here is the same as I did before but using UV’s to map the wave texture:

2 Likes