# GN: How to pass bounding box mapping to each realized instance?

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:

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

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)

• 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. Jul 8, 2022 at 6:08
• @GordonBrinkmann Thank you for your comment. It does give me a better understanding of the problem. Jul 8, 2022 at 6:16
• Short answer: Yes (see answer below). Jul 8, 2022 at 8:46
• That magic moment when the impossible is made possible... :-D Jul 8, 2022 at 10:00

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.
• @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). Jul 8, 2022 at 9:59