  Thermal photons from the photosphere may be the primary source of the
observed prompt emission of gamma-ray bursts (GRBs). In order to produce the
observed non-thermal spectra, some kind of dissipation mechanism near the
photosphere is required. In this paper we numerically simulate the evolution of
the photon spectrum in a relativistically expanding shell with a time-dependent
numerical code. We consider two basic models. One is a leptonic model, where a
dissipation mechanism heats the thermal electrons maintaining their high
temperature. The other model involves a cascade process induced by
$pp$($pn$)-collisions which produce high-energy electrons, modify the thermal
spectrum, and emit neutrinos. The qualitative properties of the photon spectra
are mainly determined by the optical depth at which the dissipation mechanism
sets in. Too large optical depths lead to a broad and curved spectrum
contradicting the observations, while for optical depths smaller than unity the
spectral hardness becomes softer than observed. A significant shift of the
spectral peak energy to higher energies due to a large energy injection can
lead to an overly broad spectral shape. We show ideal parameter ranges for
which these models are able to reproduce the observed spectra. For the
$pn$-collision model, the neutrino fluence in the 10-100 GeV range is well
above the atmospheric neutrino fluence, but its detection is challenging for
presently available detectors.
