The answer is the density of the material. the velocity of light usually depends on the properties of the material which is the density. The speed of light usually increases when the light enter a less dense medium and vice versa. The ratio of the speed of light in a vacuum to the speed of light in any material is called the index of refraction of that material.