  Gamma-ray absorption due to gamma-gamma-pair creation on cosmological scales
depends on the line-of-sight integral of the evolving density of low-energy
photons in the Universe, i.e. on the history of the diffuse, isotropic
radiation field. Here we present and discuss a semi-empirical model for this
metagalactic radiation field based on stellar light produced and reprocessed in
evolving galaxies. With a minimum of parameters and assumptions, the
present-day background intensity is obtained from the far-IR to the ultraviolet
band. Predicted model intensities are independent of cosmological parameters,
since we require that the comoving emissivity, as a function of redshift,
agrees with observed values obtained from deep galaxy surveys. The far-infrared
background at present day prediced from optical galaxy surveys falls short in
explaining the observed one, and we show that this deficit can be removed by
taking into account (ultra)luminous infrared galaxies (ULIGs/LIGs) with a
seperate star formation rate. The accuracy and reliability of the model, out to
redshifts of 5, allow a realistic estimate of the attenuation length of
GeV-to-TeV gamma-rays and its uncertainty, which is the focus of a subsequent
paper.
