The “distance” (offset) as well as the “fade length” values can be tweaked to suit your landscape dimensions and characteristics. Using the values from the image (eg. fade=1000) only a super tiny landscape will suit, but for larger landscape you might want to use values like 10k or higher for the offset value.
Anyway i did this little test, implemented the same graph with the fade value of 1000 and seem to be working just fine in 4.12 on a tiny landscape.