  When a star comes too close to a supermassive black hole, it gets torn apart
by strong tidal forces in a tidal disruption event, or TDE. Half of the
elongated stream of debris comes back to the stellar pericenter where
relativistic apsidal precession induces a self-crossing shock. As a result, the
gas gets launched into an outflow that can experience additional interactions,
leading to the formation of an accretion disc. We carry out the first
radiation-hydrodynamics simulations of this process, making use of the same
injection procedure to treat the self-crossing shock as in our previous
adiabatic study (Bonnerot & Lu 2020). Two sets of realistic parameters of the
problem are considered that correspond to different strengths of this initial
interaction. In both cases, we find that the injected matter has its
trajectories promptly circularized by secondary shocks taking place near the
black hole. However, the generated internal energy efficiently diffuses away in
the form of radiation, which results in a thin vertical profile of the formed
disc. The diffusing photons promptly irradiate the surrounding debris until
they emerge with a bolometric luminosity of $L\approx 10^{44} \, \rm erg\,
s^{-1}$. Towards the self-crossing shock, diffusion is however slowed that
results in a shallower luminosity increase, with a potentially significant
component in the optical band. Matter launched to large distances continuously
gains energy through radiation pressure, which can cause a significant fraction
to become unbound. This work provides direct insight into the origin of the
early emission from TDEs, which is accessed by a rapidly increasing number of
observations.
