I don’t understand. I have a lamp and I want to use mesh light for making post (flare etc’). To use Cryptomatte I have to pick desired layer (mesh light). But the mesh light is located behind the glass. I just can’t pick it. When I pick, another layer is selected (the glass). How can I choose the desired layer that located behind other layer?

Interesting. I would render 2 view layers, with and without front object. Second render as simple as possible, only to get shape. And mix it in compositor.
I wish someone have better idea :confused:

But all this makes it very difficult. Why not use the material index, as in the old versions? Where is the logic of the developers?

The logic is that Cryptomatte is infinitely better than an object id or material pass. It allows multiple objects to exist in the same pixel. Unfortunately the cryptomatte comp node is rather bare bones.
Cryptomatte contains the names of every object/material. If you can’t find a pixel to click on, you can manually enter the name of the item you want selected.

I tried to enter the names of objects and materials. The screen is empty. Can you make simple example and upload the .blend?

If there is an object in front of your object, cryptomatte cannot see it.

The exception is if you have a simple transparent object. Refractive transparency doesn’t work.

Are you saying that now it’s impossible to make light effects for a lamp?

I’m saying that generating a mask for a raytraced refraction is not supported.

What light effects are you trying to do, why not just set a threshold on the glare node and have the luminance of your light be the mask?

I’m trying to do flares. And I don’t really understand what you are saying.

As @SterlingRoth says, a pure glass material won’t allow cryptomatte to ‘see’ objects. Opacity is supported but reflection/refraction (secondary rays) is not. You can cheat it by mixing a Transparent BSDF with the glass material.
Or just use a glare node as suggested. It will work just as well if your light source is appropriately bright.

It’s works, thanx!

1 Like

As I understand cryptomatte, important thing is that that strange number (index?) is assigned to object (if object cryptomatte is selected) and is not dependent on camera location, object changes, modifers, mesh modification (even replacing whole mesh), render image size, sampling, ray paths etc.
So we can:

  • render once small image (50x50pix, zoom to object), only to be able to pick that number
  • render independly mask without HDRI, reflections, lights, light bounces, not important objects - just simple and fast mask
    We should not change object name.

But if there is transparency, I belive @SterlingRoth method is just better.

Still the same problem. If I just add a glare effect, the image is too blurry. I need a way to influence only the light source itself, and not the whole picture. Anybody?

Adjust your threshold for the glare node. Your light sources should be really bright compared to everything else.