Page 1 of 2

Matte problem

Posted: Mon Oct 20, 2025 6:34 am
by amanite666
PEASE HELP !!!

In C4D, I have rows of cells lined up behind each other in a clone. Each cell contains a nucleus.
For my future compositing, I need to isolate all the nuclei, without the cell membrane that is in front of them. But the membrane's ior must remain effective.
In my final pass for these nuclei, all those in the foreground must be visible, while those behind them should only be visible when the cell membrane is not in front of them.

Thank you in advance for your help !

Re: Matte problem

Posted: Mon Oct 20, 2025 8:13 am
by bepeg4d
Hi,

Have you tried with Custom AOV:
https://docs.otoy.com/cinema4d/CustomAOVs.html
Capture AOV:
https://docs.otoy.com/cinema4d/CaptureAOV.html
?

ciao,
Beppe

Re: Matte problem

Posted: Mon Oct 20, 2025 8:45 am
by amanite666
Yes, I think the solution could be with custom AOV but I don't find the way to achieve exactly what I want.

Re: Matte problem

Posted: Mon Oct 20, 2025 8:45 am
by amanite666
bepeg4d wrote: Mon Oct 20, 2025 8:13 am Hi,

Have you tried with Custom AOV:
https://docs.otoy.com/cinema4d/CustomAOVs.html
Capture AOV:
https://docs.otoy.com/cinema4d/CaptureAOV.html
?

ciao,
Beppe
Yes, I think the solution could be with custom AOV but I don't find the way to achieve exactly what I need.

Re: Matte problem

Posted: Tue Oct 21, 2025 7:48 am
by bepeg4d
Ok, please have a look at this example scene:
RefractionCustomAOV.c4d.zip
(339.14 KiB) Downloaded 9 times
Let's say that we need a mask for the red capsule inside the glass sphere:
IMG_6041.jpeg
You need to go to the Basic tab of the red material and enable the Custom AOV channel, then set it to Custom2, then go to Render AOV Manager tab and create a new Custom AOV sets to 2 and visible after refraction:
IMG_6042.jpeg
ciao,
Beppe

Re: Matte problem

Posted: Tue Oct 21, 2025 10:18 am
by amanite666
Thank you so much Beppe!!

It's almost what I need. But, in my scene, I have multiple cells (cloner) and on the custom pass, there is a lot of reflexions with other cells. Il put a Ray swich node in the specular material whit all the value to 0, except for tha camera ray (1). It's better but I've got alwys some refraction. Any idea on how the achieve this? I realy need just the capsule.
Thank a lolt!

(I put my C4D file in the message)
Image

Re: Matte problem

Posted: Wed Oct 22, 2025 6:53 am
by bepeg4d
Ok, just for calculating the mask, you can set the Specular Depth to 2 in Kernel panel:
IMG_6053.jpeg
ciao,
Beppe

Re: Matte problem

Posted: Wed Oct 22, 2025 7:06 am
by amanite666
Thank's again Beppe, but it doesn't work with a different camera angle.
Image

Re: Matte problem

Posted: Wed Oct 22, 2025 7:23 am
by bepeg4d
Weird, it work in any direction here, with a default Specular material:
IMG_6055.jpeg
The ray should't have enough depth to show extra refraction :roll:

ciao,
Beppe

Re: Matte problem

Posted: Wed Oct 22, 2025 8:15 am
by amanite666
Thank you so much! You saved me!
Once again, it wasn't that complicated, but I had to figure out how to combine the different parameters to achieve my goal.
Have a great day!
Ciao!