Discrete dipole model of radiative transfer in dense granular layers