Refractive index of dense materials