How to make original full-pass image from separate passes? I'm trying to create an image from separate passes. That is, I have a result image, which without altering the composite Combined RGBA buffer looks like following:



On this image you can see a cube standing on two planes - one that is opaque and receives shadow, and second, bigger one, which only receives shadow.

Now, what I want is to be able to work on the Combined Pass without: Shadow, Ambient and Environment Passes. So I've set up the render layer like that:



Now, in compositor I try to build the original image back, I'm doing with a following node setup:



But this fails to deliver the correct result, which is like that:



The comparison looks following:



So the question is how to combine the distinct passes back to the "full" image. I'm asking for clues at least, I mean, I've noticed that there is a weird outline caused by the Shadow Pass, you can see at the bottom of the image. The shading itself is also wrong - this perhaps because I don't know the order in which Blender combines these passes. For the Ambient Occlussion I did "multiply" in Mix node, as the AO is set up to "multiply" in World settings, and for the Envrionment Lighting node I did "add", as I guess, the environment light is adding to the end result.

Any clues that can push me forward are welcome.
First I encourage you to use image layer instead of render layer, because otherwise you will have to render the scene each time you open up Blender. It could be quite disappointing for very complex scenes. For doing so you need to save your image with all the passes by using the OpenEXR Multilayer

Now for the exact recipe (as illustrated on old the blender manual) 



Finally, I don't see the Diffuse and the glossy passes (D/I/C). You should check them before rendering as shown on this image



I hope this is helpful and Good luck!