The optical density of a medium depends upon its mass density.
Optical density of a medium is directly proportional to its mass density.