I just published a suite of Vector tools on Nukepedia (Download and Quick description here).
In this post I will to run the more nerdy of you through the math involved, in part 2 I will include mini-tutorials of example usage of these tools.
The Tools Math
Basic understanding of vectors is necessary to follow the math involved, review it here: mathsisfun.com
Luma_to_Normals: Converts an image to normals (based on Luma). This one was one I really cared about for a long time. Back in 2014 I got really close to achieve good results, but I wasn’t able to obtain the Blue channel of a normal map properly. While there are tools on Nukepedia already that attempt to achieve this, I wasn’t entirely convinced by them. I didn’t want to publish a half-baked tool, so I got back in there a few days ago and I am pretty satisfied with the result.
After some research, it seemed that the first step of converting luma to normals would be to apply some sort of Filter. I decided to use a Sobel filter. https://en.wikipedia.org/wiki/Sobel_operator
In nuke, that meant adding 2 matrix nodes, one for an horizontal filter and one vertical. I would then shuffle these into R and G.