Cycles shader that renders its objects transparent when they are 'inside' of a sphere? I have a long line (thin cylinder) that runs through a semi-transparent sphere. Using the sphere as the cylinder's 'bounds', I would like the parts of the cylinder that are inside the sphere to render transparent. Is this possible with a cycles shader?
I found that using the Transparent Depth output of the Light path node was the key for me. 

I used a Math node to control its value which gave control over how much transparency was applied to the portion of the cylinder within the sphere.