0
$\begingroup$

I have this simple projection mapper that generates the UV quickly as I want them and I would like to have this UV set exported in the FBX file. So my idea is to be able to read the data from the Shader Editor, and write it down onto the geometry using Geometry Nodes. If anyone has an easier solution, that's welcome of course.

enter image description here

$\endgroup$

2 Answers 2

0
$\begingroup$

You can't pass data from the shader editor to the geometry nodes editor. Data flows in the opposite direction. You're using box mapping, so you should be able to just unwrap your geometry using a a cube projection for (roughly) the same results : in the viewport, with your geometry selected, press U -> Cube Projection.

$\endgroup$
4
  • $\begingroup$ Thank you, I didn't know that, though I imagined it... but I still hoped that there could be a way to send some data. Anyway, I still wonder if I am the only one on the planet in need for this, as I searched a lot and found nothing similar in Geometry Nodes. Your solution here is not viable for me, exactly because I don't want to waste my time doing the projection every time. I have hundreds of objects to manage. I want this quick mapping applied continuously to the object, and then be able, in the future, to apply the GN modifier and work on the UV more in detail. $\endgroup$
    – PolyMad
    Nov 6, 2023 at 14:50
  • $\begingroup$ I know how this should be done, but I don't know enough of GN to set it up, but for somebody skilled in GN should be a joke. Take axis Z, compare all faces of the mesh with Z. For the faces with normal less than 90 degrees respect to Z, lay them down in World Space, with size and position relative to the reference object, and mark them mapped. For X, do the same on the remaining faces: compare normals, then rotate to match UV coordinates, scale and offset with reference object. For Y, take the remaining faces and and do the same as X. But my skill on GM is not enough to do all this. $\endgroup$
    – PolyMad
    Nov 6, 2023 at 14:58
  • $\begingroup$ in 4.0, you can set up a geonode tool to do this destructively at the click of a button. In the node editor header, select "tool" from the dropdown that says "modifier" and enable edit mode in the popover next to it. Then create your node tree. $\endgroup$
    – Hadriscus
    Nov 6, 2023 at 16:20
  • $\begingroup$ Your explanation regarding how the object should be unwrapped is not completely clear. Do you need the same thing as triplanar (box) mapping? or something different? $\endgroup$
    – Hadriscus
    Nov 6, 2023 at 16:21
0
$\begingroup$

I solved it by using the Modifier UV Projection.

I created the modifier and set 6 reference objects.

Then I created a cube and left only the top face. I duplicated it 5 times, and rotated it to create a cube with 6 different objects, one for each axis from both sides.

Then I linked the objects to the 6 reference objects in the modifier.

At this point, I rotated the objects in the scene to match my needs (walls, so bases all down for the vertical faces, top and bottom will be aligned later on).

This way, the main object has a world reference for mapping projection on 3 axis both sides, and they are all independent. If I want to keep the mapping, I move both the main object and the 6 reference objects. If I move any of them independently, the mapping will change.

When exporting FBX, the UV set is exported.

=====

It's my personal pipeline for production of stuff like walls, stairs, and anything architectural for real-time apps (games). I can map hundreds of objects in very little time this way, and use them as they are as unfinished objects. So I can start right away with level design even without having the definitive objects.

At the 2nd next step is cutting some details on the faces, following the texture itself. No need to remap UV then, because I have the 6 projections ready. I just add geometry and 99% of the UV will be ok.

Step 3, when everything is really ready to go, I will convert all the pieces to final geometry and the UV set will become final. Then I remap those faces that need some adjustment, but usually there's very little to do.

Below you can see the setup, the magic object in yellow-green (references) partially covered by the wall on the left. I can already use these objects for my project, I didn't need to create UV for any of these, just copy the modifier to all of them. I can change their positions to find the best UV config, it's quick and effective, and if I'll ever need to change a bit the scaling or position, it's again very fast. And finally I will add some chipped or missing bricks here and there, then they will be ready to go.

enter image description here

$\endgroup$

You must log in to answer this question.

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