  Attenuation of high--energy gamma rays by pair--production with UV, optical
and IR background photons provides a link between the history of galaxy
formation and high--energy astrophysics. We present results from our latest
semi-analytic models (SAMs), based upon a $\Lambda$CDM hierarchical structural
formation scenario and employing all ingredients thought to be important to
galaxy formation and evolution, as well as reprocessing of starlight by dust to
mid- and far-IR wavelengths. Our models also use results from recent
hydrodynamic galaxy merger simulations. These latest SAMs are successful in
reproducing a large variety of observational constraints such as number counts,
luminosity and mass functions, and color bimodality. We have created 2 models
that bracket the likely ranges of galaxy emissivities, and for each of these we
show how the optical depth from pair--production is affected by redshift and
gamma-ray energy. We conclude with a discussion of the implications of our
work, and how the burgeoning science of gamma-ray astronomy will continue to
help constrain cosmology.
