Optical depth (τ) is a measure of opaqueness along the path of EMR, i.e., the degree of absorption of light passing through the medium along the way. Intensity falls exponentially by the optical depth: a larger optical depth means more opaque: much greater than 1 (optically thick) means photons moving along this path are generally are absorbed or scattered, and much less than 1 (optically thin) means they generally get through. Optical depth is the integral of the product of the material's opacity and density over the path of the light. It is equivalent to the number of mean free paths of a photon as light passes through the medium (if they were laid end-to-end on a line). While opacity is a quality of the material, optical depth measures the effects of light passing through a specific length of material (i.e., the further through such material, the greater the optical depth), accounting for any variations in the opacity and density along the path. Like opacity, it varies by wavelength.
In dealing with the atmosphere of stars, optical depth is conventionally counted from the outer surface of the star, from above, specifically, starting with 0 at the top of the atmosphere. The optical depth for a path perpendicular to this surface is known as the vertical optical depth, a quantity that is useful in some analyses. The Rosseland optical depth is the optical depth calculated using the Rosseland mean opacity, i.e., a weighted average (across frequency) opacity.