Context : Aims : We study the effects related to departures from non-local thermodynamic equilibrium ( NLTE ) and homogeneity in the atmospheres of red giant stars , to assess their influence on the formation of Ba II lines . We estimate the impact of these effects on the barium abundance determinations for 20 red giants in Galactic globular cluster NGC 6752 . Methods : One-dimensional ( 1D ) local thermodynamic equilibrium ( LTE ) and 1D NLTE barium abundances were derived using classical 1D ATLAS9 stellar model atmospheres . The three-dimensional ( 3D ) LTE abundances were obtained for 8 red giants on the lower RGB , by adjusting their 1D LTE abundances using 3D–1D abundance corrections , i.e. , the differences between the abundances obtained from the same spectral line using the 3D hydrodynamical and classical 1D stellar model atmospheres . The 3D–1D abundance corrections were obtained in a strictly differential way using the 3D hydrodynamical and classical 1D codes CO ^ { 5 } BOLD and LHD . Both codes utilized identical stellar atmospheric parameters , opacities , and equation of state . Results : The mean 1D barium-to-iron abundance ratios derived for 20 giants are \langle { [ Ba / Fe ] } \rangle _ { 1 D~ { } LTE } = 0.24 \pm 0.05 ( stat . ) \pm 0.08 ( % { sys . } ) and \langle { [ Ba / Fe ] } \rangle _ { 1 D~ { } NLTE } = 0.05 \pm 0.06 ( stat . ) \pm 0.08 ( % sys . ) . The 3D–1D abundance correction obtained for 8 giants is small ( \sim + 0.05 dex ) , thus leads to only minor adjustment when applied to the mean 1D NLTE barium-to-iron abundance ratio for the 20 giants , \langle { [ Ba / Fe ] } \rangle _ { 3 D + NLTE } = 0.10 \pm 0.06 ( stat . ) \pm 0.10 ( % sys . ) . The intrinsic abundance spread between the individual cluster stars is small and can be explained in terms of uncertainties in the abundance determinations . Conclusions : Deviations from LTE play an important role in the formation of barium lines in the atmospheres of red giants studied here . The role of 3D hydrodynamical effects should not be dismissed either , even if the obtained 3D–1D abundance corrections are small . This result is a consequence of subtle fine-tuning of individual contributions from horizontal temperature fluctuations and differences between the average temperature profiles in the 3D and 1D model atmospheres : owing to the comparable size and opposite sign , their contributions nearly cancel each other . This fine-tuning is characteristic of the particular set of atmospheric parameters and the element investigated , hence should not necessarily be a general property of spectral line formation in the atmospheres of red giant stars .