Posted on April 18, 2022, 4:18 p.m. by ChirpyChirp99 • Last updated on June 22, 2022, 7:20 p.m.
This is probably not a well known fact with the average user who just has started working with models. Even I figured this out recently and wanted to give some publicity to this issue.
I won't go into theoretics as to why the mathematics work like this (frankly because I don't fully understand it myself and because there's plenty of articles and videos that explain it better), but I wanted to spread awareness how you can fix your weird looking normal maps that look inverted.
Basically, how normal maps work is that the RGB channels give the illusion that you are looking at a 3-dimensional object. Each color represents the direction of lighting that is going to be shining at you. R(ed) is X axis (sideways), G(reen) is Y (up and down) and B(lue) is (front and back). Y is usually the issue with normal maps.
Different rendering engines translate the coordinates differently. OpenGL wants the lighting from Y-axis to be taken from upward while DirectX wants it from below. This is referred to as "normal map right-handiness".
To put it shortly, all you need to do pretty much always when porting textures from video games (that are based on DirectX) is to just invert the green channel. Make sure the red red hue is pointing from the right and the green is from up for the correct look of the texture, otherwise the texture will look inverted or otherwise shallow lacking any depth.
Also, as a side note, sometimes your normal maps are yellow. To fix this, invert the blue channel so that it becomes white, then make sure that the red and green channels are correct as well. Otherwise your normal maps will look pitch black when rendered, because the lighting is rendered as in behind, not front as it should be.
Here are some excellent articles on more about normal maps: https://www.artstation.com/blogs/typhen/GZdL/this-is-normal-3-types-of-normal-maps https://www.artstation.com/blogs/typhen/62VP