Shade by Face Axis?

I’m trying to shade by face axis – like every face that’s perfectly flat to the X axis in black, anything that’s not in white. So if on a fresh default cube you’d get two black faces and the rest white.

I’ve been playing around with nodes but haven’t been able to figure out how to do this – is it possible?

Try using the geometry node (normal output) plugged into a separate x,y,z node. Then you can take the z from that and use math/ramps to ensure it is shades only the required direction.


Thanks! One of the things I tried was the Geometry node but didn’t think to put it through a Seperate XYZ node before the Math node – appreciate your help!