5

I made a building using geometry nodes

Having Textures but cant apply a modifier to save

It has textures and works fine but when I try to apply Geometry Nodes, Realize Instances Node makes building parts loose their UVs.
How is it possible to apply modifier and keep UV at the same time?

textures are gone

Yuri Titko
  • 632
  • 2
  • 14
George K.
  • 103
  • 7

1 Answers1

5

When realizing instances, their UVs are converted to an attribute with a name equal to the name of the UV Layer that the source object have:

enter image description here

In that image, UVMap is the uvs of geometry from instances, while uv_map is the uvs of the Mesh Grid generated in the Geometry Nodes.

The UVMap can be accessed with the Attribute node in the Material Nodes.

enter image description here

You will need to set the material of the instances to this new material with the Set Material node.

If you will use the same material for the roof, you need to merge the uv of the Mesh Grid with the realized instances uv, you can rename the uvs of the objects being instanced to uv_map:

enter image description here

Or you can merge in Geometry Nodes, we do that switching the field depending on if the geometry is from the grid:

enter image description here

enter image description here

enter image description here

enter image description here

If you will use a different material for the roof, you don't need to merge the UVs, just set the material of the roof in Geometry Nodes before joining the geometry with the instances.

If you dont merge the UVs, and use a different material for the roof, you won't need to manipulate any attribute in Geometry Nodes:

enter image description here

The only thing you would need is use the UVMap attribute in the instances material:

enter image description here

Hulifier
  • 6,048
  • 1
  • 8
  • 24
  • I followed everything and nothing happened or maybe I am stupid – George K. Jun 01 '22 at 13:28
  • @GeorgeK. can you provide a blend file with the modifications you did using this answer? that way i can search for what went wrong. – Hulifier Jun 01 '22 at 18:15
  • https://we.tl/t-KouJcIVTWv – George K. Jun 02 '22 at 12:14
  • @GeorgeK. The reason it didn't work is that you created a new material on the object with Geometry nodes where the uv attribute is used, while in my answer i modified the material of the instances. If you want to use the new material you created, you need to apply it to the instances using a Set Material node. I think that using a separate material on the final object is a better idea compared to what I did, since modifying the material of the objects that will be instanced will make them show textures only with Geometry Nodes. I will edit the answer to use that material. – Hulifier Jun 02 '22 at 17:03
  • @GeorgeK. also, if you will use a different material for the roof, there's no need for merging UV's. – Hulifier Jun 02 '22 at 17:29
  • Thank you so much – George K. Jun 03 '22 at 11:54
  • Is any possible way to export the house models with textures? – George K. Jun 18 '22 at 09:56
  • @GeorgeK. There is an answer on this forum which I can't remember that explains export file formats in detail, but I think the only export format that allows textures to be included to some extent is glTF 2.0 – Yousuf Chaudhry Jun 18 '22 at 17:59
  • Probably this but glTF 2.0 exporting uv_atribute and not real textures I need https://blender.stackexchange.com/questions/57531/fbx-export-why-there-are-no-materials-or-textures/57541#57541 – George K. Jun 18 '22 at 18:35