3
$\begingroup$

In Geometry Nodes I have an instanced object with its material appearing correctly until I drop a Realize Instances node into the tree. What breaks is the mapping. It's my understanding that support for UV mapping in GN is a work-in-progress, however this particular setup attempts to use the Bounding Box in stead of UV data - similar to what quellenform did in this answer.

Here's a simplified setup, with cubes as the instances:

↑ Here the material is using Object mapping, which I actually didn't expect to work.

Well it does work until instances are realized. Then it "breaks" (but looks like you might expect if it had no GN modifier at all). The cubes bounds are not being mapped and passed to the material. ↓

Here is the Geometry Nodes setup:

enter image description here

And the material "Bounds" that Geometry Nodes is assigning:

enter image description here

Is there a way to pass the Bounding Box mapping along to each instance in a way that even if they are "realized" the mapping remains valid?

(Created using ver. 3.2.1)

$\endgroup$
4
  • 1
    $\begingroup$ Short answer: No. Since after realizing the instances are all just parts of one big object, and the (minimum) bounding box is by definition the box with the smallest measure (area, volume, or hypervolume in higher dimensions) within which all the points lie. So you cannot split up bounding box mapping on several meshes inside the object it contains. For a long answer: well, if you convert the separate mappings of the instances to UV mapping in some way so that the UVs stay intact after realizing the instances, then you could transfer the bounding box mapping - but I don't know how, sorry. $\endgroup$ Jul 8, 2022 at 6:08
  • $\begingroup$ @GordonBrinkmann Thank you for your comment. It does give me a better understanding of the problem. $\endgroup$
    – Mentalist
    Jul 8, 2022 at 6:16
  • 3
    $\begingroup$ Short answer: Yes (see answer below). $\endgroup$
    – quellenform
    Jul 8, 2022 at 8:46
  • 1
    $\begingroup$ That magic moment when the impossible is made possible... :-D $\endgroup$
    – Mentalist
    Jul 8, 2022 at 10:00

1 Answer 1

5
$\begingroup$

You would actually only need to capture these vectors before Instance on Points in the domain Points with Capture Attribute or even easier with Store Named Attribute if you use Blender 3.2.

Solution for Blender 3.2:

enter image description here

Solution for Blender 3.1.2:

enter image description here

$\endgroup$
5
  • 1
    $\begingroup$ Thank you so much, quellenform! Makes perfect sense, now that I see it. (And it was a bonus to learn of the Store Named Attribute node ...I just updated to 3.2 after posting this, so perfect timing to learn a new feature.) $\endgroup$
    – Mentalist
    Jul 8, 2022 at 9:54
  • $\begingroup$ @Mentalist You are welcome! 😊 $\endgroup$
    – quellenform
    Jul 8, 2022 at 9:56
  • $\begingroup$ @Mentalist ...just as a hint: use the node Store Named Attribute but really only if you still need the data outside the nodes or if you remove them afterwards, because otherwise you might store unnecessary ballast into the geometry (that's why there is the node Remove Named Attribute). $\endgroup$
    – quellenform
    Jul 8, 2022 at 9:59
  • 1
    $\begingroup$ Oh, that's good to know! I was just thinking "I hope people don't bury their attributes in node trees now instead of routing them out to the modifier where they can be easily found". However, I can totally see the case for attributes that serve some purpose within the tree but don't need to be made accessible from the modifier. $\endgroup$
    – Mentalist
    Jul 8, 2022 at 10:09
  • 1
    $\begingroup$ I was jumping through all kinds of hoops trying to get Object Space per instance (rather than this, which is Generated Space per instance) .. but it turns out this is a great way to do that, too, if you scale your captured bounds in parallel with instance-scaling, further down the line. $\endgroup$
    – Robin Betts
    Jul 8, 2022 at 12:33

You must log in to answer this question.

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