Author Topic: Normal Maps - reversing direction?  (Read 4350 times)

0 Members and 1 Guest are viewing this topic.

Offline richardfunnell

Normal Maps - reversing direction?
« on: April 20, 2020, 12:14:50 pm »
When using a Normal pass generated from KeyShot as a Normal Map, I usually have to reverse the bump direction in order for the reflections to be correct.

Reversing the direction is much simpler than swapping the R/G channels, but is there a reason why the normal output is different from global "normals" vs local texture definitions? It's been a source of interest for me for a while now. I'm imagining things are a bit more complex "under the hood" for this question :)

Offline DriesV

  • Administrator
  • Hero Member
  • *****
  • Posts: 2630
  • Total likes: 83
  • Product Specialist at Luxion
Re: Normal Maps - reversing direction?
« Reply #1 on: April 21, 2020, 03:34:08 am »
Hey Richard,

I'm assuming you're using the 'Camera Space Normals' option for the Normals pass output?
There are basically two styles of doing tangent space normal maps, sometimes called DirectX- and OpenGL-style normal maps. By convention, DirectX uses a left-handed coordinate system, while OpenGL is right-handed. The output from Camera Space Normals in KeyShot is of the OpenGL-flavor. However, when used as normal maps in KeyShot, the height indeed needs to be inverted. The reason for this is mostly historical legacy and backward compatibility.
At least the output with Camera Space Normals matches normal maps from e.g. Poliigon, where the height also needs to be inverted in KeyShot for the reflections to be correct.

Dries

Offline richardfunnell

Re: Normal Maps - reversing direction?
« Reply #2 on: April 21, 2020, 09:40:52 am »
Hey Dries,

Thanks for the detailed response, exactly the kind of information I was hoping to hear!

Yes, these images are using the "camera space normals" option instead of the KS Front (ortho) camera. When Normals were an EXR output, there was a decent amount of post processing to get it useable and not having to do that is much easier :)

This was a good sanity check, thank you for the help!