3
$\begingroup$

Is it possible to get any of the Instance level Attributes into the Shader without Realizing Instances? If you use Instanced Objects, you can have different Object level attributes and access them properly (rotation, location, etc.) But it seems that Instances within Geometry Nodes do not work like this.

Here is the issue I want to solve: I have created some Instances (cones in this example). They have random rotation. I have Stored their Normals as an Attribute, but it is the Normal BEFORE the rotation. So the Normals are not World Space, and they are all the same.

enter image description here

If I could pass the Instance Rotation to the Shader, I could use it to rotate the Normals into the proper space. (I do know that I can use the Geometry Node in the Shader to get the Normals. This is just a simple example. I would be doing more complex things to the Normals in Geometry Nodes first.)

It looks like the Object Info shader node will give Location of the Instances properly. Random also works. But there is no option for Rotation or Scale.

$\endgroup$
1
  • $\begingroup$ Instances are used for the purpose of duplicating data for performance. So each instance holds the same geometry data and instance-specific data is only location, rotation, scale and additional custom attributes you add to them, but you can't red those attributes in a shader... If you can afford to realize instances then the problem disappears. $\endgroup$ Oct 2, 2022 at 13:56

1 Answer 1

2
$\begingroup$

If you really just want to align the rotation of the previously captured normals along the World Space, you could simply use the Vector Transform node in the shader:

enter image description here

This will rotate the direction vectors from Object Space to World Space.


(Blender 3.2+)

$\endgroup$
2
  • $\begingroup$ So it seems you can infer the instance rotation using the difference between local and world space normal? 🤔 $\endgroup$ Oct 2, 2022 at 13:57
  • $\begingroup$ @MarkusvonBroady Yes, it seems so. Apparently the node Vector Transform processes each instance as a separate object and therefore rotates the normals per instance. ...But it may also be that I have completely misunderstood the question. :D $\endgroup$
    – quellenform
    Oct 2, 2022 at 14:04

You must log in to answer this question.

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