Rotate normal map inside the node editor?

Hey people.

In some software is possible to create a function to rotate the normal map inside the editor in real-time.
I’m talking about substance designer, painter and unreal engine.

I made some attempt by my self in blender node editor but I could not get the result.

Some of you have a solution for this?
thanks

You can add a texture coordinate and mapping node and change the z rotation. I’m not sure if there’s a way to expose just this single value so you can tweak it from the outside, for example when you put all these nodes in a group.

EDIT: Someone at Blender Stack Exchange created a node group for transforming textures.

no man, it is not that simple.

vectors need to be rotated in order to preserve the correct result.

@MmAaXx, do you want arbitrary rotations?.. It might be possible to do it…
Theoretically this might work (thought I haven’t experiment it in real case scenarios)

1 Like

That’ll rotate the normal orientation, so lighting and reflections will come along for the ride.

Compensate by applying the opposite rotation to the vector space itself: (You can use a regular mapping node for this. I just wanted quick access to the Z rotation component.)

And bob’s yur uncle.
normal_rotate

4 Likes

dang! this is amazing!
Are you selling or sharing these nodes? Where can I buy them?

The UberMapping thing? No, sir. It’s free. Link’s in my profile.

1 Like

I thought that was what MmAaXx wanted… (rotating the vector while keeping UVs in place). :slight_smile:
Your method works ok, but the part of rotating the Texture has an error: the normal map must be transformed to [-1, 1] before rotating, and then transformed again to [0, 1] when plugging it to the NormalMap node. Without these steps, the normals will not rotate around the Surface Normal.

That functionality is built into my UberMapping group. It’s the pivot section in the node. That’s why it looks correct in the animated .gif. :slight_smile:

Ohh… Didn’t noticed!! Then it’s all good! :wink:

All good indeed. And for the record, I didn’t set out to prove you wrong or anything. Having hung around this forum for a bit, I’ve gotten the impression you know a lot more about this subject than I do. :slight_smile:

Cheers!

Neither have I thought that. Actually I’m allways happy to see other people starting to mastering the math within! :wink: