Why is one render layer clipping another?

Hi folks,

Please take a look at the attached pic.

In it you can see i have two render layers. The Icosphere is in front of the cube.

What i don’t understand is: why is the icosphere being clipped by the cube? I mean, there’s a part of the ico that’s missing, and it’s the part that sticks out beyond the outline of the cube.

I’d like to avoid this if possible.

Any ideas would be much appreciated!!

Because it’s a mix node.
Use alpha over to combine by the sum of alpha mattes.

Thanks man, that works great…problem is , if i do that, i loose the ability to choose how the overlapping layers interact via the blend modes of the mix node!

I messed around with it some more and found the hack pictured below, perhaps this is the correct way, but if not, anyone please let me know!

Quite right. A setup like this would be more suitable.

Ah-ha, many thanks, and that math node also give some interesting possibilities!