KeyShot Forum

Technical discussions => Textures => Topic started by: richardfunnell on April 20, 2020, 12:14:50 pm

Title: Normal Maps - reversing direction?
Post by: richardfunnell 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 :)
Title: Re: Normal Maps - reversing direction?
Post by: DriesV 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
Title: Re: Normal Maps - reversing direction?
Post by: richardfunnell 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!