Compositing normal map from individual channels

Heya guys, i would like to know how all these game companies actually use their normal map textures which include information in B and A channels too. And on top of that the X and Y of normal map not being R and G of texture rather some other combination of channels. (example of games… warthunder, warhammer: gothic armada, Star conflict)

If the texture is set as “normal map” type it will throw away B channel and A which in this case include other texture mapping! How would i go to replicate all the things unreal do when set as normal type but done inside material? I am aware that it does clamp/restrain channel values and also apply some type of filtering but probably much more i am still missing…

I found this which partially works but depending on texture can get totally broken. (feeding X and Y channels to the “append”, my guess is there is more needed either prior or after these nodes to get proper normal map ?

297529-image-31.png

(please dont answer with “split it into a normal map texture and whatever is in other channels texture” as that increase overal size of project and require me to converted around 5k textures i already have in unreal.

Video of issue in action

Sample texture i am trying to make into normal map inside material:

Thank anyone for any help !!

actually, you should use regular normal maps, their dedicated compression results in much better/crisp results as it stores the Red channel of a normal into the RGB slot, resulting in 16 bits grayscale, then they add the blue channel into the alpha, which is also 16 bit, and combine them under the hood for very crisp results.

What you are doing results in the RGB channel having merged compression artifacts/crosstalk between RG and B channel, significantly reducing the quality, the only channel thats not affected by this is the Alpha channel, which takes up the same amount of memory (and other additional costs) as RGB combined.

So you quite wasted time combining normal maps this way --which is a very old/outdated/unoptimal-- technique.

that said, merge the two channels you need merging with Append, then add an additional append with a value of 0.5 (though this can be a variable to lower/raise normal maps a bit) and this way you can make a new normal map.

normalize is never needed as the normal input of a material does this automatically.

2 Likes

Thanks for this answer @Luos .
Is there any situation that packing channels or recreating a blue channel from a normal the way suggested above would be beneficial?

If I understand you correctly:
platforms that are limited to DXT compression, lower-end mobile. or anywhere where you have a hard-limit on filesize/memory size. though the odds of encountering that are getting lower as time progresses.

1 Like

You understood me correctly =) Thanks for the clarification and the amazing answers you gave here on this post. Learned a lot!

1 Like