2
$\begingroup$

I have multiple scenes each with different objects. I want to combine all these scenes in the compositor but when they render, all the objects from each scene overlap each other and are all transparent, so I can see all the objects when some should be hidden behind others.

To join my scenes I'm using a mix node with add.

$\endgroup$
2
  • 3
    $\begingroup$ Don't use add but alpha over. It would be easier to help you if you edit your question and add images of your current scene and nodes. $\endgroup$
    – user1853
    Commented Mar 18, 2016 at 3:19
  • $\begingroup$ Possible duplicate of this: blender.stackexchange.com/questions/43539/… $\endgroup$ Commented Mar 18, 2016 at 8:54

2 Answers 2

5
$\begingroup$

What you describe as "transparent" is the result of adding the RGB pixel information of an image to that of the others.

When using add the pixel values of each of the images are summed and will make final image brighter.

enter image description here

If you want them to create the illusion of having one image in front of another, you need to use an alpha channel and have that control how images are combined.

A proposed workflow:

  • Render each layer with a transparent background, to do that enable the Film Transparent Option for the scene.

enter image description here

  • Use the alpha channel to determine how they combine over each other. The Alpha Over node is one of the options that will allow you to do that.

The node sockets to which the images are connected determines the result:

The background image should be connected to the top socket

The foreground image or scene to the bottom socket.

The foreground's alpha channel is used to control the overlay the foreground's RGB color information on to the background.

enter image description here

click on the image to enlarge

The most basic example would be like this: where the UFO is the foreground element and is combined over the landscape using the UFO image's Alpha Channel:

enter image description here

click on the image to enlarge

If you have more than two layers, you combine one on top of another, and then combine the result with yet another layer and so on like this:

enter image description here

click on the image to enlarge

Note that if the background image has an alpha channel, both alphas are combined.

enter image description here click on the image to enlarge

An alternative to the Alpha Over node would be using a RGB mix node and using the Alpha channel of the foreground layer control the mix with the background:

enter image description here

click on the image to enlarge

Another example:

A simple scene: Three circles, the red is on top of the others and the green on top of the blue one. They've been separated in different layers.

enter image description here

Using the add operation will result on the sum of the values for each pixel for each of the RGB channels of the image, a simple A+B operation.

See what happens where the circles overlap, where each of the RGB values of a layer are added on to those of the other layers:

enter image description here

The Alpha over operation is a bit more complex: A+B(1-alpha) enter image description here

$\endgroup$
0
$\begingroup$

To do this you should not use an add node.
Instead use an alpha over if you want to combine different render layers. enter image description here

$\endgroup$
2
  • 1
    $\begingroup$ Hi Delagone :) Please notify the commenter first or add more to it, see: meta.blender.stackexchange.com/questions/436/… $\endgroup$
    – p2or
    Commented Mar 18, 2016 at 18:03
  • $\begingroup$ Hi, you're right. I'm kinda new to the community and still figuring some stuff out. will do that in the future. $\endgroup$
    – Delagone
    Commented Mar 18, 2016 at 21:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .