How can I combine these overlapping render layers? I had this scene:



Then I broke it into these two render layers:




Normally I use an alpha over node to combine render layers, but the transparency and overlapping doesn't allow that in this case. Here are the results of "alpha over" with "one over two" and "two over one".




Is there a better way to combine these render layers to get the original back? Or have I broken a rule for what can actually live on separate layers?
Render your layers with Z pass:



Combine them using Z Combine node from Color tab:



On Z Combine node check "Use Alpha" checkbox if needed.