Material ID Mask with transparent shader


I tried to create a mask that take account windows in my scene. The windows have the shader below :

I can’t have the mask in the Material ID pass with this shader. If I use only the principled, it works.

Is there a workaround for this please ?

I tried Cryptomatte instead and it works but not perfectly too, some areas are not taking account :frowning:.

Well, a workaround is to make render with a glass shader, save the viewer node result and use it as a mask but it’s not ideal.