Download

Object aligned textures how?

I need object (NOT world) aligned texture mapping. It should take the size from object coordinates (LIKE world aligned from world), ignoring UVs and should live in local object space so it sticks on the objects (NOT LIKE world aligned where you move and rotate objects through the mapping). Pinning the position of the mapping onto the objects is easy: simply subtract ObjectPivotPoint from AbsoluteWorldPosition and you get object space, BUT rotation is very tricky. How to do it and get kind of 3samax “realworld” type mapping, sticking to the objects but scaled by object space?

Before you ask I’m getting a lot of runtime imported objects into the engine and need to assign aligned and real size scaled textures to them.

There’s a material function called “local aligned texture”.

Which sadly uses the objects own UVs to triplanar blend the textures into another. The blending-masks are based on local vertex normals. The mapping is not generated from scene units (absolutensize) like I need them to do.

I think you can use Absolute World Position + Object Position, use a component mask to get just the R & G channels, then divide that number by a Scalar parameter to get the size you want, then plug that into your Texture UV input. Note that this will map the texture along the Global X & Y coordinates (like a flat plane) and then move the position to the Object position, keeping the mapping consistent with the object.

If you want the texture to be mapped along multiple axes, like a triplanar mapping would do, you could plug in the result of Absolute World Position + Object position to the World Position input on the World Aligned Texture material function.

Best of luck, let me know if you have any questions or have a visual example of what you’re trying to achieve!

Edit: Just re-read your description, you should be able to use Absolute World Position + Object Position, and then take the output and run it through a Transform node, transforming from World Space to Object Space or Local Space (sorry I’m away from my dev PC so I’m paraphrasing.)

Best of luck!

Any chance of a graphical description of this hippowombat?!

Thanks in advance.

Hello there. I found this thread looking for something similar.

This is what I worked out so far - I hope it’s helpful:

Does masking the X and Z in CheapContrast provide enough for the mapping of Y too? Asking because I don’t know. What is the function or purpose of multiplying object scale by 100?

For whatever it’s worth, I made a version of this a while ago: https://forums.unrealengine.com/development-discussion/rendering/1792637-how-to-tile-textures-without-absolute-world-position-and-texturecoordinate?p=1792831#post1792831

Mine doesn’t require an object scale input

Originally I was transforming the positions/normals like you were, but another user pointed out that you can use pre-skinned local nodes and that turned out to be cheaper.