2
$\begingroup$

When I share data between shader and geometry nodes through attributes (more concretely, I was sharing color of the object), it works perfectly, as seen on picture:

It just works

However, when I don't use the original geometry (eg. use Cube node), it stops working:

enter image description here

Why does it not work and how can I fix it? Thanks!

$\endgroup$
4
  • 1
    $\begingroup$ Does this answer your question? blender.stackexchange.com/a/268739/145249 $\endgroup$
    – quellenform
    Commented Sep 30, 2022 at 16:36
  • 1
    $\begingroup$ You could try this too: blender.stackexchange.com/a/270303/145249 $\endgroup$
    – quellenform
    Commented Sep 30, 2022 at 16:38
  • 1
    $\begingroup$ That color attibute is for the original cube only, if you want add color to an instance, use the SET MATERIAL node in front of the instance and before the Output $\endgroup$
    – Emir
    Commented Sep 30, 2022 at 16:38
  • $\begingroup$ Combination of @quellenform and Emir comments worked perfectly, thanks so much! $\endgroup$ Commented Sep 30, 2022 at 17:11

1 Answer 1

2
$\begingroup$

Just to be able to mark the question as solved, here is a short answer to this from the comments:

To transfer a color attribute from Geometry Nodes to the Shader, a corresponding attribute must be created.

This can either be passed directly to the Group Output (as seen in your screenshot), or an attribute can be explicitly created with the node Store Named Attribute.

Here you have two options.

Either you create the attribute and read it in the shader with the node Attribute:

enter image description here

Or you create a Color Attribute beforehand, store your color there, and read this attribute with the node Color Attribute:

enter image description here

In addition, a material must be assigned to the created geometry with Set Material!

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .