I need a transparent hole in a specific part of my render defined by object. For example, I have a cube. How to make an alpha-channel on the place of a cube?
There may be a simpler way to do this, but since no one's answered yet, here's a way:
Put the cube on a separate render layer from the scene:
Set transparency under Render properties:
The Scene layer image should be used for the output image. The Cube layer's alpha is inverted and used as the output image alpha.
EDIT: If you want to use this with an environment map as the background:
Use the Diffuse Color render pass:
Invert the Diffuse Color pass and use it as the composite alpha:
The holdout node can be used to cut an object from the scene.
The Holdout shader node is used to create a “hole” in the image with zero alpha transparency, which is useful for compositing
Note that the holdout only cuts through objects in the scene, you need to render with transparency and composite the scene onto the environment pass if you want the background.