The diatance is inversely proportional to its brightness as seen on earth, the farther the star is from the earth, the more dim it looks. Take the sun for example, it's the star nearest to earth. Its so bright that its brightness is called "daylight" So to speak, that is how distance affect the brightness of stars as seen on earth. That brightness also has a name, its called apparent brightness.