  We simulate convection near the solar surface, where the continuum optical
depth is of order unity. Hence, to determine the radiative heating and cooling
in the energy conservation equation, we must solve the radiative transfer
equation (instead of using the diffusion or optically thin cooling
approximations). A method efficient enough to calculate the radiation for
thousands of time steps is needed. We assume LTE and a non-gray opacity grouped
into 4 bins according to strength. We perform a formal solution of the
Feautrier equation along a vertical and four straight, slanted, rays (at four
azimuthal angles which are rotated 15 deg. every time step). We present details
of our method. We also give some results: comparing simulated and observed line
profiles for the Sun, showing the importance of 3D transfer for the structure
of the mean atmosphere and the eigenfrequencies of p-modes, illustrating Stokes
profiles for micropores, and analyzing the effect of radiation on p-mode
asymmetries.
