Visibility of distant galaxies and stars