1
$\begingroup$

How can I exclude a material from the render alpha channel, but still show the material in the color channel?

I'm used to a 3DsMax+V-ray workflow, and the obvious solution here would be to add a "wrapper material" to a material to control alpha in the alpha channel.

enter image description here

$\endgroup$

1 Answer 1

0
$\begingroup$

What you can do is using the Cryptomatte in the Compositor. First you have to enable it in the View Layer Properties, under Passes > Cryptomatte check Object.

enable cryptomatte pass

Now you can render the image (and you don't even have to set the background to Film > Transparent when using Cryptomatte) and go to the Compositor. Make sure Backdrop is enabled since you need the Viewer node.

Now add the node Shift+Add > Add > Matte > Cryptomatte (not Cryptomatte (Legacy)!) and plug the Image output of the Render Layers node into the Image input of the Cryptomatte node. Plug the Pick output into the Viewer node.

cryptomatte pick

If you now click on the Plus symbol next to the Matte ID field of the Cryptomatte you'll get an eyedropper tool with which you can pick an object in the image. Hovering over an object displays its name. If you click on it, it gets added to the Matte ID list.

adding matte id

By the way, this would also work if the Cryptomatte node was not plugged into Viewer, if you view the original render - you just need the Viewer to display something where you can pick from.

Now after you picked the yellow and red cube in this example, their names are in the Matte ID list. If you change your mind, you can always choose the Minus symbol to pick objects you want to remove from the list or add more with Plus (if there were more objects in the scene).

If you now plug the Image output of the Cryptomatte node you can see the result: the image is masked to only display the picked objects. Not only the blue disappeared, but also the background although it was not set to Transparent.

masked image

But since your goal was to have the blue cube visible but remove it from the Alpha channel, you can use the Matte output of the node to get a black and white image of the masked result (sorry mine doesn't look white, I have Filmic enabled):

matte output

$\endgroup$
1
  • 1
    $\begingroup$ Great! Just what I needed! :) $\endgroup$ Commented Mar 21, 2023 at 13:11

You must log in to answer this question.

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