stretching UV's on terrain

Has anyone solved the problem of stretching UV’s on vertical surfaces generated by heightmaps on terrain? I’m sure we are all well-aware of the issue, correct? When the offset between vertices is large (surface becomes vertical, like a cliff wall) but the UV allocation is constant you get big ugly stretched textures. Here is an example:


thanks in advance!

Somebody at least made an attempt.

I wrote a shader that eliminates stretched textures on vertical surfaces of Unity terrain: