Build a proper Cycles shadow pass in the compositor I am working on a project that requires me to have control of shadows in the compositor (specifically, to darken or lighten them.) In BI, I would simply take the shadow pass and ramp it, them multiply it back in. But my scene involves mesh lights, and the Shadow pass only has Lamps and Environment lighting.

It seems that it should be possible to get the info I need for mesh lights from Direct Passes, and for indirect light from Indirect passes. But I am stuck on how to do this without also getting too much other info from those passes. From googling around, I've seen that others have run into this problem, but I couldn't find anybody that had actually tried to solve it.

Does anyone know a way to do this? Or can it be confirmed that it cannot be done for some reason?

EDIT: It is not enough to get shadows cast on other objects, which is covered by some other answers. I need the shading on each model itself as well. This is not for a shadow catcher, it is for isolating both cast shadows and shading so they can be worked with.
I was able to solve it in the end by darkening certain passes before combining them. The usual combination method is Direct Pass + Indirect Pass multiplied by color pass. The Direct+Indirect contains all the lighting and shadow information, but does not have any material colors to throw off the ramping.

I took the direct+indirect, ramped it to get a mask of the desired darkening, then multiplied the direct+indirect by it. Then I multiplied by color, completing the combined pass. This was also done for the Gloss using a different ramp for more artistic control.