  We model the galaxy formation in a series of high-resolution N-body
simulations using the semi-analytical approach. Unlike many earlier
investigations based on semi-analytical models, we make use of the subhalos
resolved in the $N$-body simulations to follow the mergers of galaxies in dark
halos, and we show that this is pivotal in modeling correctly the galaxy
luminosity function at the bright end and the bimodal nature of galaxy color
distribution. Mergers of galaxies based on subhalos also result in many more
bright red galaxies at high $z$. The semi-analytical model we adopt is similar
to those used in earlier semi-analytical studies, except that we consider the
effect of a prolonged cooling in small halos and that we explicitly follow the
chemical enrichment in the interstellar medium. We use our model to make
predictions for the properties of the galaxy population at low redshift and
compare them with various current observations. We find that our model
predictions can match the luminosity functions of galaxies in various wavebands
redder than the u-band. The shape of the luminosity function at bright end is
well reproduced if galaxy mergers are modeled with the merger trees of subhalos
and the steep faint-end slope can be moderated if the gas cooling time in
low-mass halos is comparable to the age of the universe. The model with
subhalos resolved can reproduce the main features in the observed color bimodal
distribution, though it still predicts too many bright blue galaxies. The same
model can also match the color-magnitude relation for elliptical galaxies in
clusters, the metallicity-luminosity relation.
