# World aligned texture - Rotate projection axis

**URL:** <https://forums.unrealengine.com/t/world-aligned-texture-rotate-projection-axis/558544>\
**Category:** Rendering\
**Tags:** unreal-engine, UE5-0, Rendering, question\
**Created:** [May 16, 2022, 3:40pm UTC](https://forums.unrealengine.com/t/world-aligned-texture-rotate-projection-axis/558544 "2022-05-16T15:40:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![AquilaAbriel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AquilaAbriel](https://forums.unrealengine.com/u/AquilaAbriel)\
**Post date:** [May 16, 2022, 3:40pm UTC](https://forums.unrealengine.com/t/world-aligned-texture-rotate-projection-axis/558544/1 "2022-05-16T15:40:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 16, 2022, 5:00pm UTC](https://forums.unrealengine.com/t/world-aligned-texture-rotate-projection-axis/558544/2 "2022-05-16T17:00:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![AquilaAbriel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AquilaAbriel](https://forums.unrealengine.com/u/AquilaAbriel)\
**Post date:** [May 16, 2022, 6:01pm UTC](https://forums.unrealengine.com/t/world-aligned-texture-rotate-projection-axis/558544/3 "2022-05-16T18:01:21Z")

</div>

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?

 ![align](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/a/8/6a8f1e4e8a32c13d4ad4525e77141466ceb40856.jpeg)

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.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 16, 2022, 6:49pm UTC](https://forums.unrealengine.com/t/world-aligned-texture-rotate-projection-axis/558544/4 "2022-05-16T18:49:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![AquilaAbriel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AquilaAbriel](https://forums.unrealengine.com/u/AquilaAbriel)\
**Post date:** [May 16, 2022, 7:14pm UTC](https://forums.unrealengine.com/t/world-aligned-texture-rotate-projection-axis/558544/5 "2022-05-16T19:14:30Z")

</div>

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

 ![building](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/8/4/d8447b3d10cc0d1bb50a5594be728f141a5065a2.jpeg)

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

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 16, 2022, 7:53pm UTC](https://forums.unrealengine.com/t/world-aligned-texture-rotate-projection-axis/558544/6 "2022-05-16T19:53:01Z")

</div>

Still a lot quicker than a PHD in material physics 🙂

---

<div class="post-metadata">

**Author:** ![Nintenjo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nintenjo](https://forums.unrealengine.com/u/Nintenjo)\
**Post date:** [July 12, 2023, 10:37am UTC](https://forums.unrealengine.com/t/world-aligned-texture-rotate-projection-axis/558544/7 "2023-07-12T10:37:15Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [July 12, 2023, 2:03pm UTC](https://forums.unrealengine.com/t/world-aligned-texture-rotate-projection-axis/558544/8 "2023-07-12T14:03:00Z")

</div>

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.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/0/8/b089f4606cfd24bea4c05bab8a21100a44c55258.png)

![face_projection](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/4/9/649354e7c8de6ead9effb861563f05512e220898.gif)
