Dev Blog: Amplifying Normal Maps
Timothy
Hey everyone, in this blog post we’re going to have a look at normal maps and how to amplify their strength. There are a huge array of tools to create normal maps, from in-package baking such as Maya or Max, to specialized tools like Xnormals or even derived from textures ala Crazy Bump and Ndo2. Baking out a normal map is pretty easy, so I tend to use a few different methods, Xnormals, 3d Coat, Zbrush and Ndo2 are preferred but all offer different levels of quality in the normal map.
As such, I’ve developed a technique in Unity 3D for amplifying the strength of a normal map through the shader and providing a variable in the inspector that will give the artists more control of how powerful the normal map shows through.
The theory is really quite simple. Break the normal map into its separate channels (RGB). We don’t want to alter the “angles” of the normal map so we ignore the red and green. The blue controls how much it “pushes out” and as such if we amplify that, then it will appear stronger.
We can look at it like this; NRGB = The normal maps red green and blue values. Take Blue from that and plug it into a power expression. It’s pretty important to make sure the blue channel goes into the base value.
I use this technique in the Strumpy Shader Editor. Using the assemble node I can combine the three channels together again. You could use a split node to make sure it was only taking the blue channel into the pow node but the difference is negligible and thus unnecessary clutter. The Float input allows myself or any of the artists to use the shader in Unity and control the strength of their normal maps.
Making tools like this is not only quite satisfying but the utility of them really helps speed up future projects as well. If you guys have any thoughts on this technique I’d love to hear them.