I would like to develop a LUA nodegraph that could create a texture based on the 'height' of a mesh. It is basically a Boolean shader used to drive a mix node and draw a line at a certain distance along the x, y, or z axis. This could be in local or global space. The attached image shows a global elevation shader applied to two object. The objects are five feet high and the elevation is set to three feet. The line is blurred but I would be happy with a straight line.
I just need to know if it is even possible to do this in LUA and, if it is, some direction to get started.