5
$\begingroup$

Version 3.1.

Setup

I'm trying to follow different tutorials where objects of random colors are placed at the vertices of another object. According to this tutorial, this can (must?) be done this way:

  • Create instances of the object to be placed at the vertices.
  • Embed a custom color value in the geometry data, so it can be read by the shader when rendering the instance.
  • Use a Capture Attribute node to inject the attribute value on instances.
  • For some reason the attribute added to the instance will be lost prior to be read by the shader (explanations found are not very clear), so instances must be realized into simple geometry.

This tree just does that:

enter image description here

Now this is not the end of the story, the Capture Attribute node is indeed set to add the value to each instance (as highlighted in green above), but as instances will be removed and converted into simple geometry, the values has to be attached to some other geometry entity. A point which wasn't clearly explained in the documentation/tutorials I used. After some (painful) experimentation, I now assume the element to be used for attaching the value is defined partly in the Group Output node and partly in the Geometry Nodes modifier. E.g. this setup will add the color to vertices (points):

enter image description here

with the name InstanceColor:

enter image description here

(CubeColor, the name of the socket is not used). And looking at the spreadsheet view, the value is actually found at the right place:

enter image description here

To reuse the attribute value in the material/shader, the right name has to be used (another point which was missing in the documentation/tutorials I used):

enter image description here



Questions

This quite long introduction to explain what is my limited knowledge of geometry nodes and attributes and this is still confused. Could someone help in explaining:

  1. The reason the Capture Attribute node has to be connected to the socket of the Group Output. After all values are injected into the instances, using the Geometry, so why using the socket.

  2. The reason the name to be used to store the attribute in the instances is defined in the modifier parameters rather than in the Capture Attribute node. The node is already used to define the element where to store the value (Point, Instance, etc)

  3. The reason there are two default values for the attribute, what is the use of the one found in the side panel, it seems unused.

    enter image description here

  4. The reason instances must be realized.

$\endgroup$
6
  • $\begingroup$ You may be interested in the Blender Studio tutorial Geometry nodes from Scratch. It explains attributes in detail, including custom attributes. $\endgroup$ Jun 6, 2022 at 3:10
  • $\begingroup$ @MartyFouts: "You may be interested in the Blender Studio tutorial" --> Blender Studio has T&Cs which are disproportionate to the occasional tutorial watcher: "You will indemnify, defend, and hold harmless the Blender Studio and its affiliates, directors, officers, employees, and agents, from and against all third party actions that: arise from your activities on the Blender Studio Service". I'm not Mr Musk. A no go, I don't encourage such sites. $\endgroup$
    – mins
    Jun 6, 2022 at 10:34
  • $\begingroup$ That is a boiler plate phrase you will find in Stack Exchange's TOS as well. You pretty much can't use the net if you avoid that clause. $\endgroup$ Jun 6, 2022 at 13:38
  • $\begingroup$ @MartyFouts, The difference is SE content can be read without accepting/subscribing. Blender is repeating NaN mistake by writing a poor documentation and forcing subscriptions for tutorials: In the 90s Blender was free, but the documentation was sold by NaN, only extracts were freely available. I supported NaN at that time by buying the documentation, money was actually wasted according this summary). $\endgroup$
    – mins
    Jun 6, 2022 at 15:32
  • $\begingroup$ No that's not a difference. You can read the free content on Studio without subscribing, just like SE. Your legal liability in that case is exactly the same as reading SE. You cannot post questions on stack exchange without creating an account and accepting the TOS. Your legal liability in that case is exactly the same as Blender Cloud. You've accepted the same TOS here that you reject there. $\endgroup$ Jun 6, 2022 at 15:46

1 Answer 1

2
$\begingroup$
  1. The reason the Capture Attribute node has to be connected to the socket of the Group Output. After all values are injected into the instances, using the geometry, so why using the socket.

There are no reasons ;-) But in your example you have random color per instance. If you plug in a random node directly into the output node, it makes a random color per domain, not per cube, for example per face:

enter image description here

Of course, if we can store data in instances, it would be looks like that:

enter image description here

But unfortunately, instance domain is not supported in shaders yet (see #4). Without what, we have to use Capture Attribute to make Random Value node generate values per instance.

  1. The reason the name to be used to store the attribute in the instances is defined in the modifier parameters rather than in the Capture Attribute node. The node is already used to define the element where to store the value (Point, Instance, etc)

It was designed for reusing nodes. You have the same node setup, but different objects with different attribute names.

But! In 3.2 you may save attributes in GN directly like this:

enter image description here

  1. The reason there are two default values for the attribute, what is the use of the one found in the side panel, it seems unused.

Well, it is used. Then you add a new Group Output node, you will see that it will have the default value.

  1. The reason instances must be realized.

Because instance domain is not supported in shader nodes yet Blender wiki:

Instance domain attributes are only supported in Geometry Nodes

Without that we are limited to convert instances to the real geometry, which Realize Instances does

$\endgroup$

You must log in to answer this question.

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