Volumetric gradient based on density? I am trying to make a material that is translucent at the surface and opaque in the middle.  How can I control the gradient?

I would like the gradient to correspond with the mesh; i.e. not simply radiate from the origin or something like that.  (If my model was a tree, the leaves and bark would be translucent while the branches and trunk, under a couple inches of bark, would be opaque.)

For reference, I am trying to replicate this glacial ice:
The absorption node seems to be what you are looking for.



You can also add surface shaders on top of the volume shaders, for example: