In this tutorial, we will look at creating a – high quality – Normal Blend map in OSL.
We focus on building an external function and a shader and how to tie it all up and build a small user interface with a couple of practical entries, such as MIX and a switch, pr map.
Youtube video, from scratch to working shader, rendered with Arnold in 3DS MAX 2020.3
Colin Barré-Brisebois and Stephen Hill, the authors of the article, illustrates various technics an artist can use, in the attempts to blend 2 normal maps, while preserving details.
We are going to look at their own proposal – reoriented blending – ( which is a superior blend method compared to almost any other technic ) and write a small OSL utility shader around the function.
TIP: If you import larger constructs with some predefine names, you can easily change any OSL type that matches it with a #define newname construct.
OK, so we now have a function and we build a user interface.
Now we want to connect everything. Lets move to the shader functions body and try set up a system that uses all the instruments we just made.