2
$\begingroup$

Can somebody please explain me the Anonymous Attributes and Capture Attribute in simpler words. How do attributes interpolate; and when Capture Attribute can be used. I am excessively simple-minded with the Manual; and tutorials I have watched didn't seem to help.

$\endgroup$

1 Answer 1

2
$\begingroup$

Don't worry about the documentation not being clear to you - unfortunately it's just not clear enough on many things.

The default cube has an attribute on all vertices - it has a name position, therefore it's not anonymous:

You can Modify this attribute either by using Set Position node:

Or by treating it like any other Vector attribute and just adding to it:

In both cases the attribute gets modified when the Geonodes modifier is evaluated:

Now let's say you want to change the attribute randomly using Noise Texture:

(⬅ not synced ➡)

Now let's say you want to add another noise to only affect the Z coordinate, but affect it by a lot. This maybe could be achieved just by increasing the Z component of the Vector Multiply node, but let's say it's easier to reason about the logic by adding a separate Noise Texture:

(old Noise Texture is called General, the one just added is called Vertical)

You can see that this noise has more scale, so it's more rough, fine-grained, however, the animation part (the driver), divided current frame by two more orders of magnitude, so the added change on Z should actually be much slower than that of the first Set Position. Let's test it:

This is not what I meant by "much slower". What happens is that while the 2nd Add Node changes the coordinate very slowly, by only 0.0001 unit every frame, The 2nd Position node connected to it doesn't contain the original vertex position - it is evaluated after the first Set Position was evaluated (read this answer to understand the order in which nodes are evaluated), so the vertex positions are already changed by the first noise. Effectively, we're traversing through the noise with the speed between 0.0001 (when the first noise outputs absolute black color and doesn't offset a vertex, so the only offsetting is done by the 2nd Add Node) and Vector((0.3, 0.3, 0.3001)).length = ~ 0.52, which is a lot for a noise of scale 20.

To solve it, you need to access the original position. For example by reading it from the original geometry using the Transfer Attribute node:

Now it works as it should:

How does this Transfer Attribute node work? Current geometry has the same number of vertices as the original geometry. Also, each moved vertex has the same index as the original vertex. So by passing the currently evaluated vertex's index (and I'm doing that by not connecting anything to the Index input of TA node), and passing the Position field, the position of the vertex with the same index in the connected geometry is read - the original position.

Finally, rather than transferring, you can just save the original position and pass it along the geometry:

The effect is the same, but now the geometry contains this additional attribute. However, you don't see it in the spreadsheet, because you never output it, so it's discarded at the end, without a name - it's anonymous. You can confirm it resides on the geometry by attaching a viewer:

Finally finally you can output it and give it a name to save it:

$\endgroup$
5
  • $\begingroup$ Thank you a lot!! But I have several questions, if you will. First of all, we can use capture attribute instead of attribute transfer for the same result, right? Secondly, (very stupid question, probably) how the vector input in Noise Texture works, and how does it affect the Noise Texture itself? And lastly, we use Attributes in order to store information of object in some state, which we indicate (e.g. original position at the start)? And sadly, I did not understand the reason of the object phasing through itself. Could you, please, explain it again? $\endgroup$
    – Imp
    May 7, 2022 at 17:41
  • 2
    $\begingroup$ @Asc 1. In this specific case TA and Capture can be used to the same effect, but notice the layout differs - in TA case you read from the original geometry when you need it, in CA case you save from the original geometry and pass the field forward. I think CA is more readable, because it's immediately clear you're reading previously saved value for the same element (same domain, index, geometry), just a previous version of it. In case of TA you could for example read a position of an edge of another object with the same index as the current vertex's index: i.imgur.com/lY2gp4v.gif $\endgroup$ May 7, 2022 at 18:06
  • 2
    $\begingroup$ @Asc 2. Imagine that you design a location in Blender, and create an API, where someone can ask what's on coordinate X, Y, Z in that location, and the API responds for example "a tree". Noise Texture is like that, except it the location is clouds, the response is color (how dense is the cloud on that X, Y, Z coordinate), and rather than the location being generated and stored, it's just computed based on some mathematical formula based on the inputs - the vector location, the scale (actually all the scale does is multiplies the vector) and so on. $\endgroup$ May 7, 2022 at 18:10
  • 2
    $\begingroup$ @Asc 2a. So if you change Vector, you move inside this world. If the change of the vector is small enough and smooth, it feels like traveling through the world i.imgur.com/zhpmdb2.gif 3. I didn't actually explain why the object phases through itself, because it's irrelevant... But it's simple: the output of the noise texture is between 0 and 1. Then the Z component is multiplied by 20, so now it's between 0 and 20. The height of the cube is only 2, so if bottom vertex is moved 20 up, and top vertex is moved 0 up, the bottom vertex is now 18 above the bottom vertex. $\endgroup$ May 7, 2022 at 18:18
  • $\begingroup$ Sorry, but I become exponentially more confused with each of your explanations. I still don't understand the difference between CA an TA and how Vector input in Noise Texture works. I will ask these questions separetely. Anyway, thank you! $\endgroup$
    – Imp
    May 7, 2022 at 18:33

You must log in to answer this question.

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