Ok, i think it's ready to release. Tweaked the code to the max, better performance isn't possible for this.
Dynamic Viewdistance 2.1
What it does:
Well, basically it extends the VIEWDISTANCE setting you have in the video options to something more flexible. Instead of having one fixed viewdistance, you set a min and max range (where min range should reflect your actual viewdistance setting) and the addon will increase/decrease viewdistance depending of your height above sea level. This is what it did before and this is what it still does.
So whats new in 2.1?
When playing large scale mission with a lot of units and scripts runnin, you could have serious performance hits and increasing viewdistance would it make it even worse. So i included a FPS counter and whenever a lower limit of FPS is reached (can be set by user), the addon tries to reduce viewdistance to come back to playable performance/FPS. But it will never go below the min viewdistance you've set (although i'm thinking about to introduce a allow override function in it).
I've also included a min height level. If the player is below this lower limit, the viewdistance will not raise. Only when you go above this level (in area or in air vehicle, no matter) it will start raising viewdistance. But also here, below this "offset value", viewdistance will not go below your set min limit.
The first time you pass an area in a plane or a chopper, there will be noticable stuttering. This is caused by ArmA since it has more data to load (landscape, textures and objects) than usual. This stuttering only happens on first fly-over, from the second pass on it should be gone and you should have good performance and higher viewdistance. Sadly there's no way to reduce or even eliminate this effect.
Also there are known incompatibility issues with other addons (thx Foxhound to pointing at) that aren't extended Eventhandlers compatible. I'mm affraid you have to choose between the addons that interfere unless the addonmakers releases a fixed version of theyr addons.
Should have been solved!
Please read the readme.txt (duh) for instructions about installing and configuring the addon (take your time to find best settings for your PC, once it is done, you might forget about it :D).
STM dynamic viewdistance