How to render Alpha Masks?

How to render a solid Alpha Mask?

Level:
A Cube on a plane.

I want to output two alpha masks:

  1. a solid alpha mask from the cube
  2. a solid alpha mask from the plane

Currently, I am using the Stencil Layer for masking.

It looks like, it’s broken and the masking doesn’t work.
Result of the alpha channel:

Is it a bug or am I missing something essential here?
Thx.

if you move the camera so the cube is visible against the black background, the alpha of the cube is visible in the generated alpha?

yes, because there is no other geometry in this simple file.
However, it shows that the Stencil Alpha is not working when using a Layer.

The Cube is the only object added to the Stenicl Layer.
But as you can see… the alpha doesn’t work.

You can re-produce this issue with a simple file.

Add a Cube and a plane and add the cube to the Layer.
Make sure you have the Layer in the render settings selected.

Render .exr - it’s not working.