Shadow Pass Errors

I’ve been working on a simpler way of compositing and have come into a slight problem. I’ve been trying to render the shadow catcher plane with the image projected onto it to make the compositing much easier and more simple. However when I try to get the shadow pass it picks up any of the dark spots of the image too, so when I lay the shadow down over the image it also darkens the already dark parts of the image.
Below are the base image used as the backdrop that is projected onto the plane. The scene setup, and final composite, and the shadow pass. As you can see the shadow pass should only show the torus shadow, but it shows the dark parts of the backdrop image also. It’s not as obvious on this backdrop, but I was playing around with another one that had more dark areas and they all showed up.



Attachments


This is the shadow pass from the floor object. You can see the vignetting in the corner and the dark parts of the mountain that are showing even though there is no shadow cast there. Any ideas why?

There definitely is a bug in the shadow pass layer. Below is an even simpler image of just a cube and plane with two different procedural textures applied. The shadow pass picks up all the black in the textures too.

OK I solved it. In the world tab if you turn the ambient lighting (world color) all the way to black it fixes the problem. Strange but it works.
So far this seams to be the best way to do quick compositing. Diffuse indirect lighting is accounted for very well as you can see the surroundings affect the objects, and the purple is cast onto the roads. Refraction and Reflections work OK.
[ATTACH=CONFIG]475932[/ATTACH][ATTACH=CONFIG]475933[/ATTACH]