We study the effect of local stellar radiation and ultraviolet background radiation ( UVB ) on the physical properties of damped Lyman- \alpha systems ( DLAs ) and Lyman limit systems ( LLSs ) at z = 3 using cosmological SPH simulations . We post-process our simulations with the Authentic Ray Tracing ( ART ) code for radiative transfer of local stellar radiation and UVB . We find that the DLA and LLS cross sections are significantly reduced by the UVB , whereas the local stellar radiation does not affect them very much except in the low-mass halos . This is because the clumpy high-density clouds near young star clusters effectively absorb most of the ionizing photons from young stars . We also find that the UVB model with a simple density threshold for self-shielding effect can reproduce the observed column density distribution function of DLAs and LLSs very well , and we validate this model by direct radiative transfer calculations of stellar radiation and UVB with high angular resolution . We show that , with a self-shielding treatment , the DLAs have an extended distribution around star-forming regions typically on \sim 10 - 30 kpc scales , and LLSs are surrounding DLAs on \sim 30 - 60 kpc scales . The DLA gas is less extended than the virial radius of the halo , and LLSs are distributed over the similar scale to the virial radius of the host halo . Our simulations suggest that the median properties of DLA host haloes are : M _ { h } = 2.4 \times 10 ^ { 10 } ~ { } M _ { \odot } , SFR = 0.3 ~ { } M _ { \odot } yr ^ { -1 } , M _ { \star } = 2.4 \times 10 ^ { 8 } ~ { } M _ { \odot } , and Z / Z _ { \odot } = 0.1 . About 30 per cent of DLAs are hosted by haloes having SFR = 1 - 20 ~ { } M _ { \odot } yr ^ { -1 } , which is the typical SFR range for LBGs . More than half of DLAs are hosted by the LBGs that are fainter than the current observational limit . Our results suggest that fractional contribution to LLSs from lower mass haloes is greater than for DLAs . Therefore the median values of LLS host haloes are somewhat lower with M _ { h } = 9.6 \times 10 ^ { 9 } ~ { } M _ { \odot } , SFR = 0.06 ~ { } M _ { \odot } yr ^ { -1 } , M _ { \star } = 6.5 \times 10 ^ { 7 } ~ { } M _ { \odot } and Z / Z _ { \odot } = 0.08 . About 80 per cent of total LLS cross section are hosted by haloes with { SFR } \lesssim 1 ~ { } M _ { \odot } yr ^ { -1 } , hence most LLSs are associated with low-mass halos with faint LBGs below the current detection limit .