# Rotate World Aligned Texture Based Off Vertex Color?

**URL:** <https://forums.unrealengine.com/t/rotate-world-aligned-texture-based-off-vertex-color/1973198>\
**Category:** Asset Creation\
**Tags:** unreal-engine, question\
**Created:** [August 12, 2024, 7:39pm UTC](https://forums.unrealengine.com/t/rotate-world-aligned-texture-based-off-vertex-color/1973198 "2024-08-12T19:39:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![YOUMADD3N](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@YOUMADD3N](https://forums.unrealengine.com/u/YOUMADD3N)\
**Post date:** [August 12, 2024, 7:39pm UTC](https://forums.unrealengine.com/t/rotate-world-aligned-texture-based-off-vertex-color/1973198/1 "2024-08-12T19:39:43Z")

</div>

Hello,

I have a mesh that I have used vertex painting in Maya to color different sections of it. Is it possible to use these vertex colors to automatically rotate / offset the world aligned texture I apply to it?

This is a cabinet door which will require wood grain direction to change on different sections of the mesh.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/9/2/392e099b9d68bdf2c1ad15c99ab46275f85f138e.png)

As an example, this is what I am trying to do -

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/6/6/3667c135dd5da23ab200e28b00d02ded55d012c1.jpeg)

---

<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:** [August 13, 2024, 1:13pm UTC](https://forums.unrealengine.com/t/rotate-world-aligned-texture-based-off-vertex-color/1973198/2 "2024-08-13T13:13:07Z")

</div>

Sorry, attempt number 3 🤣 ( it’s been a long day )

Yes, you can do that

> [@How to rotate a "world aligned texture"](https://forums.unrealengine.com/t/how-to-rotate-a-world-aligned-texture/32532/4):
>
> Hi! Found quite an easy way to do it! Just open the WorldAlignedTexture function by double-clicking on it. Find Mask nodes And add custom rotation to each of them (block A). If you want to control the rotation outside the function you could add block B. It will give you control for texture rotation over each axis!

Also this ( you would add the world aligned texture node )

> [@Can't find a node for rotating world aligned texture](https://forums.unrealengine.com/t/cant-find-a-node-for-rotating-world-aligned-texture/328583):
>
> Hi! I am working on a material function for a tiled floor/ceiling texture, which I intend to use as a master material to create instances from. All floors and ceilings in my project are 64x64, and as such it should not be too hard. The problem I have is that upon applying it to a floor in my project I found that rotated by 180 degrees. Theoretically this shouldn’t be to hard to solve… had it not been using a WorldAlignedTexture node. If I had a TextureSample node, I should have been able to fl…

Or, you can write your own world aligned texture node. If you double click it, you can see what’s inside…

---

<div class="post-metadata">

**Author:** ![YOUMADD3N](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@YOUMADD3N](https://forums.unrealengine.com/u/YOUMADD3N)\
**Post date:** [August 13, 2024, 7:40pm UTC](https://forums.unrealengine.com/t/rotate-world-aligned-texture-based-off-vertex-color/1973198/3 "2024-08-13T19:40:45Z")

</div>

Hi Clockwork - I was able to find those posts through some google searches before I had made this post but they weren’t quite what I was looking for. It is my understanding these are exposing parameters in a material instance to allow an artist to change the rotation of the xyz projections independently of each other.

I am wanting to apply one material to a mesh and have it rotate based off of the vertex colors I painted on that mesh coming from Maya.

So for example let’s say I paint one section of the mesh black and I want that section to have a rotation of 0 degrees. I paint a different section of the mesh so that the material is now rotated 90 degrees.

Unless there is something I am missing from those two posts that you linked then please do explain!

Thanks

---

<div class="post-metadata">

**Author:** ![RecourseDesign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/recoursedesign/32/1194503_2.png) [@RecourseDesign](https://forums.unrealengine.com/u/RecourseDesign)\
**Post date:** [August 13, 2024, 7:50pm UTC](https://forums.unrealengine.com/t/rotate-world-aligned-texture-based-off-vertex-color/1973198/4 "2024-08-13T19:50:36Z")

</div>

It would be a lot more efficient to just make sure those UV sets are correctly rotated in your UV map - then the shader doesn’t need to apply some expensive GPU instructions every pixel to rotate them.

---

<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:** [August 13, 2024, 7:57pm UTC](https://forums.unrealengine.com/t/rotate-world-aligned-texture-based-off-vertex-color/1973198/5 "2024-08-13T19:57:12Z")

</div>

You see that you can make your own triplanar material, and it shows how to rotate the UVs.

You can copy the code from the ‘world aligned texture’ node, and the UV rotation code, and add in your own bit so you can decide which part to rotate using the mask.

It’s quite a lot of hassle 🙂
