Some small improvements

Sped up LOD calculation. Fiddled with some stuff. Started work on
terrain shader.