World aligned texture - Rotate projection axis

I have a building in my project, which walls are rotated at a 22.5 degree angle. If I use world alignment, the projected textures on the walls are distorted. (As I expected)

What I actually want is the world alignment to be “object aligned”. I know there is a node called “LocalAlignedTexture”, but that node relies on the model UVs, which I don’t have.
(And I don’t want to have three additional uv channels for the local XY and Z axis…)

To be clear, I don’t want to rotate the texture itself. I would like to rotate the projection axis.
By default the texture is projected from the X / Y and Z axis. But I would like to project from an angle off the Z axis. (Like rotate the entire object space, to align with the xyz axis?)

The “WorldAlignedTexture” node has an input for “WorldSpaceNormals” which I assume is what I’m looking for. But so far I was not able to figure out, how I have to modify the object normals to appear rotated, the way they need to be. (Nah, forget about that. I think that parameter just modiefies the directionality of the surface, not the direction of the projection…)

Additionally, I also need to “rotate” the “WorldAlignedNormal” projection, which I assume will be even harder to achieve…

Well if somebody could help me figure that out, that would be awesome.
Thanks for reading.

1 Like

If you look in the node, you can see the same thing as in many youtube tuuts ( before they had this node ), which shows you how to do this for one axis, and the node blends 3.

I’m assuming you can make the axis a parameter, because it is just a vector.

However, you’re right, the normals is a mare. And it’s a lot easier to use the pre made node for that. I don’t know ( off the top of my head ), if any of the normal mapping nodes give you a parameter for the project axis.

1 Like

Obviously my math knowledge is insuffiecient in that regard.
I assume the “gree area” is where the “WorldAlignedTexture” node defines the X and Z axis?

By masking out the Red channel of the vertex normal for the front projection and masking out the Blue channel for the top projection?
The first lerp blends between the X and Y channel and the second lerp blends between XY and Z.

Which means, I have to rotate the incoming vertex normals.

My first guess was to use the “RotateVector” node and rotate the vertex normals to align with the X, Y and Z Axis but I obviously have no idea, how to use that node correctly.

1 Like

I think you’re right with what you have so far. I have almost no idea how to specify the parameter for this, but I know it’s possible.

What is MUCH easier, is to export the mesh and put a proper UV on it in Blender. You might also be able to do this in 5 with the new mesh tools.

1 Like

Well if it was just a simple box, unwrapping UVs would be the way to go… but it’s not quite. ^^
Just for visualization:

The distortions on right part of the building is what really annoys me.

1 Like

Still a lot quicker than a PHD in material physics :slight_smile:

1 Like

Did you ever get to the bottom of this? I have a similar setup as you with lots of models that have no UV information, but i want to use a tri-planar mapping (world aligned mapping), but have its projection aligned to the objects local pivot.

Ive followed some tutorials but none really seemed to give me what i was looking for… I tried plugging Object Local Pivot node into the WorldPosition input on WorldAlignedTexture but no joy…

I was looking at this again just now.

What you need to know, is where you are on the vertex, as if a UV plane was projected onto it.

This projects onto 4 out of 6 faces and can handle rotation, but has some sort of scaling effect based on camera distance.

face_projection

1 Like