I have a scene with two different render layers. The first one is a background with Sky texture. The second one is some images of mountains with alpha channel. For second layer I need Transparency to have an alpha channel to get a background with Sky texture as a sky. The thing is if I enable transparency, the first layer renders as one total alpha channel. If I disable transparency the second layer renders without alpha channel and I can't apply the first layer as sky because the second layer overlaps it by solid black. if I render them separately I lose one of them.
The problem is that the layer with the landscape and the clouds does not have an alpha channel (that is why the alpha over operation does not work). In the film section enable "transparent"
To use the background set on the world settings enable "environment" on the layer passes.
Then connect the environment socket of the rendered layer to the alpha over node to use as background: