  One of the remarkable phenomena in the laser-matter interaction is the
extremely efficient energy transfer to $\gamma$-photons, that appears as a
collimated $\gamma$-ray beam. For interactions of realistic laser pulses with
matter, existence of a background field plays a crucial role, since it hits the
target prior to the main pulse arrival, leading to a cloud of preplasma and
drilling a narrow channel inside the target. These effects significantly alter
the process of $\gamma$-photon generation. Here, we study this process by
importing the outcome of magnetohydrodynamic simulations of the target
interaction into particle-in-cell simulations for describing the
$\gamma$-photon generation. It is seen that the background field effect plays
an important positive role, enhancing the efficiency of laser pulse coupling
with the target, and generating high energy electron-positron pairs. It is
expected that such a $\gamma$-photon source will be actively used in various
applications in nuclear photonics, material science and astrophysical processes
modeling.
