C++ Pattern Node
(SideMask Arnold)
A custom pattern node that can create gradient masks based on the angle between normals and incidence, creating a Fresnel - like effect, as well as the X- position in either world space or object space.
Final Render
Reference









BREAKDOWN

A node is created by executing the code. The code would create a node inside of Maya. Maya needs to be restarted every time the code is changed and executed.
Rear Color : Color away from the light ray direction.
Front Color : Color from the direction of the light ray.
Swap : Changes the Rear and the Front Color.
Cross Dissolves: Amount of Rear or Front Color taking over each other.
Blur : Amount of each color blurring into each other.
The node's output color would be connected to the shader's input of base color. If wanted can be connected to any inputs that allows value of RGB.
Maya Scene

Rendered
(Cross_Dissolve 1.0)
The scene is created with an object with the shader. However, the shader would affect normals that are not correct. This is because the shader would calculate the ray of incidence to shade the front-facing color. The higher the Cross Dissolve Number becomes the higher the rear color starts to take over.
Blur would blur the two colors as to where they would meet. It would blur the edges of each color.
Project Set- Up
The models were created with polygons inside of Maya and were animated. With one light source from one direction.
Each of the model groups were given an individual shaders with the wjsmoothSideMask.cpp node connected to it.
Each of the nodes were separately animated to change it's amount of dissolve and blur in the objects.
Then RENDER.



FINAL THOUGHTS
Compared to Renderman's language understanding C++ for Arnold was a new challenge for me. The biggest struggle for the project was learning and exposing myself to more of the language the more you learn the more you can change or create with it. Later on in the process, I would like to develop my C++ skills for Arnold to create masks for different shaders so it could be used for the post-pipeline, compositing.