Making some projects with Motion Tracking, and illuminating the scene with an HDRI, I found that it was impossible to capture a projected shadow of one object into another object, since there is no direct light source.
For this reason I have thought that through an object with negative light, was possible to project a shadow around the desired object. This shadow could be used for creating a mask of other shades.
In the scene I show, there are four monkeys, two with white diffuse material, and two duplicates emitting negative light from the last layer. By adding 1 to the “AO SHADOW CACHER” render layer get the desired shadow.
I leave here, the scene I have used and capture.
En esta escena la sombra està muy exagerada. La solución esta pensada para escenas con la luz menos contrastada i más indirecta, pero creo que de este modo se ve más claro.