With the geometry node, I can retrieve the z coordinate for use in shading. Also, I can use map range, truncate, and divide, to "posterize". Is it possible to produce level curves, that is what would happen if you used some kind of edge detection after posterization.
An example of a function surface with level curves on the texture:





