In the last 2 weeks ive been taking a break from tools to port my shader library to MaterialX. MaterialX is an open source cross platform standard for materials and features a graph editor with many of the nodes and functions you would find in HLSL/CGFX. It was developed by ILM and is gaining traction in a lot of studios recently. While it has many of the nodes you will be familiar with if you have built shaders for Unreal or Unity, there are a few that I wasn’t able to locate and ended up building myself. There are also a few nodes where its important to understand what they’re doing to save you time and nodes.
Linear Interpolate (Lerp)
Lerp is one of the most common blends in games but not found in MaterialX. Putting this into a compound allows you to duplicate it and use it like a regular node like you would in Unreal/Unity
Camera Position
MaterialX does not have a node for the camera position which is needed for a number of effects. Instead you can use a transformpoint node to transform (0,0,0) from camera to world space
Normal Maps
Normal maps can be sampled with a regular texture node set to RAW and a normalmap node. The normalmap node handles the unpacking of the texture (*2-1) and the transformation into worldspace. Call me paranoid but I normalize my normals just in case the geometry is strange.
Fresnel
Fresnel blends are useful for a lot of things. While MaterialX does not have a node for that you can build a graph to accomplish the same thing using our custom camera position. We subtract the world position of the geometry and normalize it, then get the dot against the surface normal. MaterialX does not have a one minus node, but that can be easily created with a float subtract – just set the first pin to 1. Taking the Power of that value will produce a Frensel whose tightness is controllable by the constant in the graph
Combining RGB channels in Arnold is bugged
I encountered a bug with Arnold where it looked like my surface normals went through the blender. To reproduce it in Maya 2025, you just need to combine the rgb channels of a texture back together and then use a normalmap node like normal. In the above picture, the first 2 pins of the switch work as expected. When the channels are passed in individually to the normalmap or normalize node in the final 3 pins the normals break. This rules out detail normals in Arnold for now, which is dissapointing.
Anything else important to add to this? I’ll probably find some more as i progress in rebuilding my materials