This question already has an answer here:
I am learning how to use blender for motion graphics, and I wanted to create a sort of blur-to-fade effect, and now I am trying to blur one object (with nodes) but I fail in getting the right composition of the render layers.
I have a scene with two cubes, each on different layers, each layer as a separated render layer.
Using nodes, I use the two render layers as inputs, I blur one and leave the other as-is. Then I want to compose the output so that only the objects are composed (one object over the other), but apparently both images, including backgrounds, are mixed.
I tried to use Alpha Over, to my understanding it should work only on alphas of the image, but it seems to work on colors in some way.
I am using Cycles to render, and the world background has no alpha in the color, but I tried changing it and there is no difference in the output.
Here's a screenshot with the set-up.
Note in the bottom-left corner that the two cubes are overlapping: that is happening because I am using
Fac = 0.8 in the Alpha Over node, but if I leave it to
1.0, I can see only the non-blurred cube and the other is hidden. If I use
Fac = 0.0 I can see only the blurred.
I thought that Alpha Over would mix the images using only alpha channel, disregarding the red background, but obviously I am doing something wrong, because they are mixed with the background as well.
Where am I doing wrong? I hope it's clear what I want to achieve.
I tried following this video, and I basically want to get the same result.