View distance calculation