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!

My problem right now, stumbling into this thread as an outsider, is that I really can’t tell from this “what the problem is.” That is to say, “what you are shooting for.” When you say, “lose the ability to choose how the overlapping layers interact …” what exactly do you mean?

This is, in some ways, what they call an “XY Problem.” Where you describe various ways of solving a problem without clearly expressing what the problem is. As “future people just like me” stumble upon these threads – or search and find them – this “added closure” is very beneficial.