Galaxy formation models have recently emphasized the role of mass assembly processes in shaping galaxy populations : mergers, hot accretion, cold flows, etc. But the diversity of morphologies, colors and star formation histories of massive galaxies is still largely misunderstood, and galaxy properties seem to largely depend on internal processes. in particular ISM dynamics, star formation processes, and feedback mechanisms. Adaptive-resolution techniques for hydrodynamic simulations now make possible to develop models where the main scales of dense gas clouds and clustered star formation can be correctly resolved. Simulations of entire galaxies can now capture supersonic turbulence and small-scale shocks in a multiphase ISM. New predictions on when and how galaxies formed their stars and how feedback processes act in a multiphase ISM can thus be made. The impact on the global evolution from blue disks to red spheroids is quite significant. In particular, our models suggest that various modes of star formation can exist in the Universe, depending on galaxy types and environment. Early-type galaxies seem to have less efficient star formation, and keep their molecular gas more stable than disk-dominated systems. At the opposite, starbursting mergers can enter a super-efficient mode of star formation, which is not just the high-activity end of the Kennicutt relation for quiescent galaxies, but a different regime characterized by increased turbulence and fragmentation, enhanced mass fraction in dense gas phases, and high star formation efficiencies. While this provides a theoretical explanation for recent observations of two star formation regimes (Daddi et al., Genzel et al. 2010) and for varying excitation of the CO molecule, it also shows that existing cosmological models cannot properly describe the star formation history of galaxies but that newer simulations including cold ISM physics can lead to a better understanding of the structural evolution of galaxies.