I made a high poly model and then baked its textures onto a low poly model.
Now I want to give another normal map's details to the model. How can this be done?
I adapted the UDN Blending method from this article, for cycles nodes.
The simple formula is:
"Normal map 1" (nm1) the large distortion, "Normal map 2" (nm2) the small details.
nm1.x + nm2.x = X,
nm1.y + nm2.y = Y,
nm1.z = Z
- Split the normal maps in the their three separate channels with a Separate XYZ node.
- Add the X channel of both normal maps together with a Math node set to Add
- Add the Y channel of both normal maps together with a Math node set to Add
- Make the new vector with a Combine XYZ node. Plug the component X into the X input of the Combine XYZ node, and the component Y into the Y. Take the Z from the first normal map.
- Add a Vector Math node set to Normalize. Take the output from the Combine XYZ node and plug it into the first slot of the Normalize node.
- Add a Normal Map node. Take the output from the Normalize node and plug it into the color slot of the Normal Map node.
Another option is to use Multiply instead of Add for combining the X and Y channels. The bonus with this is, I have found no need for the Normalize node. The resulting normal map will look different from the method above.
I tried both methods presented here (by David and Hellfireboy), but neither of them seemed to work correctly (at least for image textures).
I kept searching online and eventually found this nodesetup.
It's very complicated, and I honestly don't understand it, but it works superbly. Thought I'd post it here for anyone else looking.
Here's the method I came up with: Multiply the normal maps and then divide the output by the (non-color) color of a flat normal.
0.50196 for Red and Green instead of
0.5 because it's the color of a flat normal for normal maps baked in Blender and the result is more accurate when compared with the normal maps rendered separately.
I tried the method from Blend Swap shared by Andre Price but it produces some kind of banding (I saved the output as PNG so it's not the result of lossy compression):
I made node groups for cycles and the compositor (notice that in the compositor the color space of the images must be sRGB, not Non-Color):
The reason being that using XYZ the image was coming out too dark (eyes and mouth are one normal map while the outer circle is a second one)
Using some baked Tangent space normals maps, it looks like the radcapricorn's blendswap node group works well, but the same result with a simple setup can be achieved.
It looks like combining the normal maps images give bad results, it's better to combine the normal map nodes vectors.
Here is my setup :
You can easily change any of the normal maps strength and fix the result modifying the color value of the color Mix/Divide node.
In my experiments on this from all the great ideas here, I noted that if you don't normalize the normal you will experience boosted subsurface scattering and not have proper highlights. I tried the differences with the second vector in the normalize node [aka Vector Math (Normalize)] being 1 or 2 or the 0.50196 on the first two values and there was really no difference of course because they are basically normal enough. The default or 0.5 is in my tests sufficient.
So in the end merging both Normals from a "Bump" (procedural texture) and a "Normal Map" (Baked from a High res sculpt to retopologized version), the usage of (two vector math nodes) add followed by normalize was sufficient. In this situation the original "Bump" was with 1/4 strength and 1/5th the distance, while of course the "Normal Map" was baked and set to strength 1.0, so I basically doubled (aka re-adjust to taste with your new setup ~ it seems they mitigate so maybe the smaller detail gets boosted and not the retopo match) the distance and Strength of the pre-merged Normal outputting nodes, to match the original (full high res sculpt and procedural temp texture) result best.
For me it seems like the easiest distillation of the ideas posted so far with some testing effort of rendering a real subsurface scattered head sculpt, (and therefor worth posting ~ I hope its helpful input/feedback).
As a Final note I'm not sure I won't just replace the procedural texture with a hand painted one (skin texture) [so combined] as that makes more sense in the end.