Home Unreal Engine

world align normal issue - rotating meshes

polycounter lvl 10
Offline / Send Message
Ramseus polycounter lvl 10
This might be a strange one. We've just noticed at work that on world aligned materials (which we're using for mesh ground tiles) when a mesh gets rotated the direction of the normals seems to rotate with it. To illustrate the problem, this is one plane duplicated four times and each rotated 90 degrees. The seam is the seam between meshes. Wtf is even happening? It's like the light rotates with the mesh.

worldalignnormal1.jpg

and this is as simple as I can get the world alignment nodes. I tested with epic's mat functions and the same results
worldalignnormal2.jpg

We could just make a bunch of redundant pieces and never rotate any of them but that sounds like a terrible 'fix'.

Replies

  • wes.sau
    You're reorienting the UV's in world space, but the material is reading it as tangent space.
    Simply input your normal map texture2d into a Vector Transform node set to Source:World and Destination:Tangent. I just tested this with the default UDK template map cube meshes and this fixes it.

    Also a side note, I suggest changing your multiply to a Divide, with the masked WorldPosition in the top input of the Divide node, then the scalar in the bottom input (if these are swapped then it's badness) This way, you can specify the actual length of the floor piece in units (like "200") and it will fit exactly, as long as the floor pieces are aligned to the grid every 200 units.
  • r4ptur3
    Offline / Send Message
    r4ptur3 polycounter lvl 10
    dude, thanks!!! Had this problem with a rotating fan a while back.
  • Ramseus
    Offline / Send Message
    Ramseus polycounter lvl 10
  • wes.sau
    Note that I've not tested this to see if it fixes baked lighting/specular (probably not). As long as you're only dynamic lighting these pieces then this is your fix. I'll look into the baked specular/lightmap stuff this week if I can make the time.
Sign In or Register to comment.