The way the sidemask works is by applying different colors or materials to the front and the rear of the meshes.
Alternate Render of Side-mask Optical Illusion. The color changes were made by keying the parameters on the tkSideMask shader node in maya
Step 1: Build the sidemask script and apply it to an AiStandardSurface mtl in maya. tkSideMask.cpp Script:
https://github.com/tylerklimekartist/VSFX755Script/blob/master/tkSideMask.cpp
The goal of the C++ side-mask project was to create and utilize a C++ script to mask different portions of a 3D mesh based on the direction of the normals. I took this as an opportunity to do something a little different and make a "2D Optical Illusion" with 3D tools.