It is a great challenge to present realistic light sources in a virtual environment given the limited luminance range of an electronic display. Previous studies show that a glare illusion can enhance the perceived luminance of an area, which is an effective way to improve the realism of light sources in virtual environments. However, it is unclear what kinds of luminance gradients are appropriate for generating virtual light sources. In this study, we investigated the quantitative rule governing the perception of self-luminosity and applied the rule to improve the fidelity of light sources in virtual environments. In particular, light spots with different luminance gradients were presented on a liquid-crystal display (LCD). The participants were asked to report whether or not a luminance spot looked like a self-luminous light source. The probability of the spot being identified as a light source was calculated at each luminance gradient. We observed a critical band of luminance gradients which are a range of power-law exponent. Once the luminance gradient of an image fell into that range, the image was mainly perceived as self-luminosity. The critical band could not be explained by either the local luminance contrast or the total luminance energy. Interestingly, natural image statistics showed that the band matched with the luminance gradients of light sources in natural images. The perception of self-luminosity depends on the specific luminance gradients which are accumulated by human perceptual experience to light sources on natural images. Moreover, we generated virtual light sources with different surrounding luminance gradients and the gradients around the peak of the critical band won the highest rating of perceptual fidelity. These results provide a quantitative description of the perception of self-luminosity, which offers a guideline of how to improve the fidelity when rendering light sources in a virtual environment.