I have a mesh with a UV-mapped texture. With Geometry Nodes, I would like to add beads to this mesh using Instance on Points, and these beads should take on the color of the underlying face. I tried using a texture to set the color of the instances, but the texture does not hold the UV map of the input geometry mesh. How can I connect Input Geometry -> Transfer Attribute (Color) to the Set Material node (color) of the Instance on Points node? I want the instances to "sample" the color of the input geometry.
The current solution for Blender 3.2+ is the following:
You simply get the UVMap of your mesh with
Named Attribute and put it as a vector into the node
Image Texture. Here you use the same image as in your shader.
The resulting color attribute is then stored in the geometry with
Store Named Attribute.
As always in such a case, the node
Realize Instances must be applied here after the instantiation, because only in this way the instances also receive different color values.
In the shader you can easily query these color values with the node
Important to note in connection with Cycles is the following point:
If you want to use Cycles, you have to create a Color Attribute with the name Color in the Object Data Properties.
I'm pretty sure this is a bug (as is so often the case with Geometry Nodes), but as soon as you use the node
Distribute Points on Facesinstead of the existing points of a mesh, it all stops working for some reason I can't figure out. With an existing Color Attribute, however, it does. In Eevee it also works without the Color Attribute.
PS: If you are using an older version of Blender, this post may help you:
GN: How to pass an instancer's localized texture color to its instances?