Triplanar mapping would be extremely useful for a project I’m working on. I found out about the pre-made material expression WorldAlignedTextures_Complex and it’s working fine. The problem is the textures are projected along the world-space axes, which causes the alignment to change depending on the orientation of the StaticMeshActor the material is applied on. I would like to be able to rotate the object without affecting the material (the textures should be projected along object-space axes instead).
Tried applying the transform from world to object space myself in the material using the cross product of ObjectOrientation and VertexNormalWS (https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/ExpressionReference/Coordinates/#objectorientation). Seems like anything based solely on ObjectOrientation will not work as it provides the up-vector, which does not contain any info about the rotation along Z-axis. Not sure if VertexNormalWS is the correct input to use either.
Tips? Here are a few pics to illustrate: