I found this interesting: the game determines the maximum depth for each unit based on it's location. It samples 4 different areas to determine the maximum depth for the unit's location. This maxiumum depth is NOT the depth at which the terrain is rendered though

If I let the unit descend to the maximum depth it can bump into the terrain even though the terrain is not really there