Is it possible to use a normal map with a rotator and preserve the up direction?

I have something that I want to rotate around. Instead of creating a skeletal mesh or an InterpActor, I’m wondering if I can just build the rotation into the material. I can get the rotation working on the diffuse easily enough, but rotating a normal map doesn’t work. If for example I have the normal map of a sphere, with light coming directly from the top, when I rotate the normal map to the right, it looks like the light is coming from the right. Does anyone know if it’s possible to rotate a normal map without breaking it?

The only kind of rotation you should be doing in the material, is rotating the UV coordinates.
If you properly rotate the UV coordinates, and use those rotated coordinates for each of the maps you sample, everything will Just Work (tm.)

Rotating the UV coordinates here and confirmed it does not Just Work ™.

That normal map is just a sphere. If I were actually rotating a sphere, the lighting direction would not change like it does in the video.

What I’m imagining needs to happen is custom lighting and transforming the lighting vector along with the rotation, probably with some dot products on the lighting vector components and sin(Time) muckery, but I was hoping there was an easy way to do it.

Oh! I just saw that this was UDK, not UE! I should find a way to make that not show up in the list of topics to read, as I know nothing about that version, sorry :frowning:

What I can see from the screen shot, is that the normal map seems to be in object space, not tangent space. (I could be wrong – it’s hard to tell with extreme off-center normals.) Object (or world) space normal maps don’t work well under rotation, as you clearly show! Doesn’t look like you have a tangent basis available, though? If you do, you need to (counter)-rotate that to compensate. Sorry I can’t help more.

here: Rotating Normal Maps - #4 by mAlkAv_An

I know it’s UE4 but all these nodes exist in UDK

1 Like

Thanks so much! I never thought of doing it that way. For the thing I wanted to do, I eventually set up some interp actors. This is much better.