The results of investigation of 43 peaked R-band light curves of optical transients of gamma-ray bursts with known redshifts are presented. The parameters of optical transients were calculated in the comoving frame, and then a search for pair correlations between them was conducted. As a result of the statistical analysis, a strong correlation between the peak luminosity and redshift was found for pure afterglows and the events with residual gamma activity, which can’t be explained as an effect of observational selection. It suggests the cosmological evolution of the parameters of the local interstellar medium around the sources of gamma-ray burst. In the models of forward and reverse shock waves, a relation between the density of interstellar medium and redshift was built for gamma-ray burst afterglows. It was shown that for GRB host galaxies the star formation rate increases with redshift.