Published online by Cambridge University Press: 24 July 2015
Scattering line polarization and the Hanle effect are among the most important mechanisms for diagnostics of the solar and stellar atmospheres. The fact that real stellar atmospheres are horizontally inhomogeneous makes the spectral synthesis and interpretation very challenging because the effect of thermodynamic fluctuations on spectral line polarization is entangled with the action of magnetic fields. This applies to the spatially resolved as well as to the averaged spectra. The necessary step towards the interpretation of such spectra is to study the line formation in sufficiently realistic 3D MHD models and compare the synthetic spectra with observations. This paper gives an overview of recent progress in the field of 3D NLTE synthesis of polarized spectral lines resulting from investigations with the radiative transfer code PORTA.