I'm using the GIS addon (https://github.com/domlysz/BlenderGIS) to import digital elevation models into blender. So far so good, it puts a regular mesh at the right coordinates at the correct scale and everyone is happy. Except... When I start shading, I'd like to use a different gradient along the objects z axis for below sea level geometry than for above sea level geometry and use vertical exaggeration (scaling along z).
In my current setup, I'm using the object coordinates from a texture mapping node, the separate xyz node to get the z component and then create masks for below 0 and above 0 using the math node. I've used the map range to convert fixed boundaries (similar to a map legend, with fixed minimum depth and maximum elevation) to 0 and 1 which seems to work ok I guess. I then use the binary land mask to mix the depth shader with the land shader. However, it feels clunky to do it like that. Also, this doesn't work when vertical exaggeration (scaling along z) is used and then applied to the object. I've attached a screenshot of my shader setup and the current shading (this is in Eevee, but it works in Cycles as well).
As you can see, my setup is quite procedural but it cannot handle vertical exaggeration (when applied to the mesh). I'd love to somehow use the generated coordinates (since they are between 0 and 1), but then I'd need the min and max of z as well and this is where my understanding of the math nodes doe snot get me the desired results.
Any help would be appreciated!