How can i make a color transparent in node editor I have these renderlayers:



In compositor I subtracted the second renderlayer from the first one (or used the difference node, since in this case they result to the same image)


But where the cube is, is now black (of course, since this is where the cube is, in both renderlayers). Is it possible to make transparent only where it's black on the image, so not object related, but just regarding the color of the pixel?
You can use the object index mask and the alpha over node to make the object transparent in the node editor.

Set object index:


Add the object index render pass:


Node setup: