Comment History
XnaFreak's avatar
One more tips to fix Normal Map problems:

Different game engines, using tangent space normal maps will have a different native required direction, or "handedness" for the RGB channels in a normal map, sometimes referred to as "Swizzle Coordinates".  To use use it in Blender,  you have to swizzle (swap or invert) the RGB channels. wiki.polycount.com/wiki/Normal…

How to invert the channels:
Invert the Y/green channel with RGB Curves
goto UV/Image Editor, select the normal texture, then Image, invert, flip green channel, save the image.

Even with the same  "Swizzle Coordinates", the blue channel range can differ. www.deviantart.com/xnafreak/ar…
I would not recommend to Change the Blue layer (Z) of the image to White (255)! The Z value can be calculated from the X and Y value.
Range 0..1 float, eq 0..255 signed integer
float usually        Z = sqrt( 1.0 - X * X - Y * Y )
float for Blender  
Z = sqrt( 1.0 - X * X - Y * Y ) * 2.0 – 1.0
 www.nvidia.com/object/real-tim…

XPS use a blue channel range from 127 to 255, the "flat" value is 255
- According to my knowledge, Blender use a blue channel range from 0 to 255), the "flat" value is 255
- VALVE use a blue channel range from 128 to 255, but Valve's "flat" bump map textures use 248  developer.valvesoftware.com/wi…

Like mentioned, some 
game engines define a "Phong mask" or "Specular map", or "Gloss map" in there Normal maps alpha channel, so disable Alpha on Normal Map Texture Node.

XCurtainX's avatar
The technicalities behind normal maps always confuse me.
Look like I have a lot of reading to do. Thanks for sharing this.
XnaFreak's avatar
The technicalities behind Normal maps are easy.
comments.deviantart.com/1/7542…

Basically, a surface (face or vertex) 'Normal' is a direction vector (part of the vertex/geometry) normalized to the length of 1.
If the light hits the surface parallel to the normal, then that part of the surface is in bright light (diffuse color).
If the light shines the surface at right angles to the normal (parallel to the Tangent), this part of the surface is dark (black).
A 'Tangent Space Normal Map' bend the underlying surface Normal to 'fake' a high ploy mesh.
Lets say, middle red/green do not bend the Normal (flat bump map color), full red bend the Normal 90° to the right side; zero red bend the Normal 90° to left. Full green bend 90° up, zero green bend it 90° down.
-> (swizzle +x+y+z eq R is left/right, G is down/up, B is Z).
Invert a channel: +x-y+z eq R is left/right, G is up/down, B is Z
Because the Normal points always to the outer site of the surface, and the length of the Normal is 1, the Normal can only cover a half sphere with the radius of 1. So to describe the top of a vertex normal, the coordinates values ​​X and Y are sufficient. Z can be calculated (and the blue Z value is always greather than a middle blue value -> Bluish Normal Map).
RGB Swizzle XYZ and YXZ is Bluish 
Swap  channels (Blue is not Z-axis):
RGB Swizlzle XZY and YZX is Greenish
RGB swizzle ZXY and ZYX is Reddish
So to convert your green Normal map to the Blue map, just use a image editor and swap the Green and Blue channels.
To check the XY-axis, read this tutoral -> Examining Bump maps and how to fix them

Because the coordinates values ​​X and Y are sufficient,
that's why some game engines use a texture with only two channels (The 3Dc format stores only two channels RG). Many game engines use an RGBA texture with 4 channels, and store other textures in the blue channel and in the alpha channel of the normal map. Some engines, like Blender, waste memory space and store also the Z value in the blue channel.
XCurtainX's avatar
I should probably mention that I have never used the XNALara/XPS software.
I've never touched any 3D modeling software, except Blender.
In late 2016, after animating in SFM, I started using Blender, and it took me more than a year to get a grasp of the program.
It took me longer to gain the confidence to make tutorials for people who:
- are scared of Blender
- have a learning disability
- are visually impaired in someway
- have a limited education

These are the parameters I have to work with.
It takes me a long time to demo and condense everything in the most visually pleasant way.

I usually write out my tutorials on DigitalEro first because the forum has a convenient collapse function with the [spoiler][/spoiler] tag, which makes it easier for people to navigate through the topics.
On DeviantArt, I haven't found a way to do this. Too many HTML restrictions.
I don't like to make a page too long unless I can make it easy on the eyes.

For the past day and a half, I've been thinking about how I can incorporate what you wrote, into this page.
I think I can do it, but it will take me a some time since this a completely new subject for me.

If you can apply my similar parameters, I can either incorporate it into this page or link to whatever page(s) resources you have that fits those parameters. I will still use the links you provided earlier, I just have to make sure the reader is focused while traversing 3rd party links.

My goal is to end Gatekeeping, and make F/OSS more prominent around the world.
Blender 2.80 is a great step towards that, since more schools and institutions are getting involved with its development.

I'm half asleep while writing this, so I'm sure I missed something.
XnaFreak's avatar
I love your tutorials.

Unfortunately, I do not have the gift to formulate something understandable. I will never be able to write tutorials. 
So I share my experiences and information for the purpose of others using them as background information. I do not expect to find my information in your tutorial. It would be counterproductive (incomprehensible / insatiable).

Normal maps are not "just" 
XNALara/XPS related. The technicalities behind Normal maps are the same for 'video games', 'Blender', 'XNALara' ...

Perhaps, the next sentence will be useful, as part of your tutorials, as an essence of my thousand words:

"Blender Normal Maps should looks usually  
Bluish. If your Normal Map looks Greenish, then just swap the Blue and Green channel of your map (with Photoshop, GIMP ...).
If your
Normal Map looks Reddish, then swap the Blue and Red color channel."




BTW,
I neither 
- scared of Blender (I use it since 2.48)
nor
- I have learning disability (just trouble with english)
nor
- visually impaired in someway (except I use a Wacom Cintiq 12-Inch Pen Display)
nor
- have I a limited education (I have a education as game designer in Milan and a degree in computer science in Freiburg.)
but I like how you write your tutorials and your work is useful for me.


XCurtainX's avatar
Thank you, I appreciate that a lot.

You wrote,
"Blender Normal Maps should looks usually  Bluish. If your Normal Map looks Greenish, then just swap the Blue and Green channel of your map (with Photoshop, GIMP ...).
If your
Normal Map looks Reddish, then swap the Blue and Red color channel."

In other words, if you're making a model strictly for the Blender environment (renders/animations), the Blender user should edit/convert the Normal Maps into a type that is best for Blender (Bluish type?).
Otherwise, if the Blender user is just exporting a model to a different game engine, the Blender user should edit/convert their Normal Maps according to the game engine's requirement.

Did I understand that correctly?

If so, as a bonus, I would really like to show Blender users some of the Normal Map examples you mentioned:
- Bluish, Greenish, Reddish, etc.
If you have some good examples, I can add them as thumbnails.
Then I can do a little demo of the swapping process you mentioned (either in Photoshop/GIMP or with Blender's Node Editor).
XnaFreak's avatar
Yes, you understand that correctly.
+
If
 the Blender user just importing a model from a different game engine, the Blender user should edit/convert their Normal Maps from there game engine Swizzle Coordinates according to the Blender requirement. (ex: If the the Normal map is Reddish, swap RGB to BGR or GBR; eq The prevailing color of the map is the last letter of the destination)

Sure. Here
sta.sh/2158h4p3ndjq
(To convert the reddish BGR_ZYX.png to 
Bluish RGB_XYZ.png, I have used  IrfanView->Image->Swap colors->RGB-BGR; eq I have "swapped" the red color channel with the blue channel; eq I have "swapped" the Normal  Z  coordinate with the X coordinate)