Apply mask/material by angle of an face
You could take the dot-product of the normal of the surface with the unit Z vector, as a measure of the angle with Z.
It's cos(the angle with Z), if you want to arccos it, for the actual angle, in radians.