We examine the temperature history of gas accreted by forming galaxies in smoothed particle hydrodynamics ( SPH ) simulations . About half of the gas follows the track expected in the conventional picture of galaxy formation , shock heating to roughly the virial temperature of the galaxy potential well ( T \sim 10 ^ { 6 } { K } for a Milky Way type galaxy ) before cooling , condensing , and forming stars . However , the other half radiates its acquired gravitational energy at much lower temperatures , typically T < 10 ^ { 5 } { K } , and the histogram of maximum gas temperatures is clearly bimodal . The “ cold mode ” of gas accretion dominates for low mass galaxies ( baryonic mass M _ { gal } \la 10 ^ { 10.3 } M _ { \odot } or halo mass M _ { halo } \la 10 ^ { 11.4 } M _ { \odot } ) , while the conventional “ hot mode ” dominates the growth of high mass systems . Cold accretion is often directed along filaments , allowing galaxies to efficiently draw gas from large distances , while hot accretion is quasi-spherical . The galaxy and halo mass dependence leads to redshift and environment dependence of cold and hot accretion rates , with cold mode dominating at high redshift and in low density regions today , and hot mode dominating in group and cluster environments at low redshift . The simulations reproduce an important feature of the observed relation between galaxy star formation rate ( SFR ) and environment , namely a break in star formation rates at surface densities \Sigma \sim 1 h _ { 75 } ^ { 2 } { Mpc } ^ { -2 } , outside the virial radii of large groups and clusters . The cosmic SFR tracks the overall history of gas accretion , and its decline at low redshift follows the combined decline of cold and hot accretion rates . The drop in cold accretion is driven by the decreasing infall rate onto halos , while for hot accretion this slower mass growth is further modified by the longer cooling times within halos . If we allowed hot accretion to be suppressed by conduction or AGN feedback , then the simulation predictions would change in interesting ways , perhaps resolving conflicts with the colours of ellipticals and the cutoff of the galaxy luminosity function . The transition at M _ { halo } \sim 10 ^ { 11.4 } M _ { \odot } between cold mode domination and hot mode domination is similar to that found by ( 17 ) using 1-d simulations and analytic arguments . The corresponding baryonic mass is tantalisingly close to the scale at which ( 68 ) find a marked shift in galaxy properties , and we speculate on possible connections between these theoretical and observational transitions .