  The treatment of dust attenuation is crucial in order to compare the
predictions of galaxy formation models with multiwavelength observations. Most
past studies have either used simple analytic prescriptions or else full
radiative transfer (RT) calculations. Here, we couple star formation histories
and morphologies predicted by the semi-analytic galaxy formation model MORGANA
with RT calculations from the spectrophotometric and dust code GRASIL to create
a library of galaxy SEDs from the UV/optical through the far Infrared, and
compare the predictions of the RT calculations with analytic prescriptions. We
consider a low and high redshift sample, as well as an additional library
constructed with empirical, non-cosmological star formation histories and
simple (pure bulge or disc) morphologies. Based on these libraries, we derive
fitting formulae for the effective dust optical depth as a function of galaxy
physical properties such as metallicity, gas mass, and radius. We show that
such fitting formulae can predict the V-band optical depth with a scatter
smaller than 0.4 dex for both the low and high redshift samples, but that there
is a large galaxy-to-galaxy scatter in the shapes of attenuation curves,
probably due to geometrical variations, which our simple recipe does not
capture well. However, our new recipe provides a better approximation to the
GRASIL results at optical wavelength than standard analytic prescriptions from
the literature, particularly at high redshift.
