0
$\begingroup$

I'm trying to rotate a set of textures (albedo, roughness, normal) using Texture Coordinate and Mapping nodes in Blender 2.83. Location and Scale properties work properly, but when I change Rotation the shadow isn't right. Looks like direction of light also changes. You can see on the second screen - rotation is 90 degree and it looks like the light is on the bottom and not on the right (considering shadows, not luminosity). On third screen I rotated the plane itself 90 degree and it looks right. No rotation Rotation Rotation plane I've tried different outputs of Texture Coordinate, types of Mapping and types of Normal Map, but cannot find the right combination. Could you please help?

Edit 1: added solution for 90 degree rotation based on michaelh answer Rotation 90

Edit 2: added solution for custom rotation based on michaelh answer and scurest comment Rotation 55 Rotation 55 with math

$\endgroup$
2
  • $\begingroup$ To be honest, everything looks fine to me. You have the nodes set up right, and the shadow "appears" accurate. I think the "artifacts" you are seeing ares more a function of the "pattern" of the texture than anything else - try the same thing with a couple different materials and see if it still looks " wrong. $\endgroup$ Aug 25, 2020 at 12:51
  • $\begingroup$ Yes, couple of other texture sets exhibit the same behavior. I've added third screenshot where the plane itself is rotated 90 degree and it looks right. Of course it was only possible because it's a square and rotation is 90 degree. $\endgroup$
    – casperbear
    Aug 25, 2020 at 13:48

1 Answer 1

1
$\begingroup$

When you rotate a normal map, a good way of thinking about is that you are rotating the light direction as well. (Which is what you're seeing.)

To rotate correctly by 90°, you'll have to rotate the "light direction" back by -90°.

You can do this swapping the X and Y vectors. You also need to invert the (orig) Y. See here:

Nodes

This is how you rotate by 180°:

nodes2

EDIT: Re. angles which aren't multiples of 90°: It is possible, but a bit more complicated.

Here's a node setup:

enter image description here

So, I made a Node Group. Let me know if this works correctly or if I made a mistake. ;)

EDIT2: scurest has added an easier method in the comments: Rotate the output of the Normal Map node via Mapping Node.

So, these two are identical:

enter image description here

$\endgroup$
5
  • $\begingroup$ It worked, thank you. But is it even possible to rotate by let's say 55 degree? $\endgroup$
    – casperbear
    Aug 25, 2020 at 15:24
  • $\begingroup$ I've updated my answer to include this. $\endgroup$
    – michaelh
    Aug 25, 2020 at 19:04
  • 1
    $\begingroup$ Can you use a mapping node to rotate the normal coming out the normal map node instead? $\endgroup$
    – scurest
    Aug 25, 2020 at 21:10
  • $\begingroup$ Oh yeah! That's much easier, of course. Good thinking! That was also a good way to verify that my node group works correctly. I'll include it in the answer. $\endgroup$
    – michaelh
    Aug 25, 2020 at 21:55
  • $\begingroup$ Thank you, I reproduced the easier solution and added as Edit 2. $\endgroup$
    – casperbear
    Aug 26, 2020 at 2:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .