Can cryptomattes be used to change the color of an object seen through glass?
For example, can I change the color of this torus including the part seen through the sphere?
When I use the cryptomatte picker I only see the part that is not seen through glass:
If cryptomattes can’t do it, is there any other way to do it (hopefully one that doesn’t require do do multiple renders)?
Cryptomatte supports opacity but not refraction.
To adjusted refracted objects you’ll need to isolate them with a combination of render/view layers and shader passes.
so does that mean I have to do multiple renders?
For instance if I want to change the Torus color alone I would have to do a render without the cube, right?
That would be solved with LPEs easily but maybe not AOVs alone… anyway we’ll be able to give it a shot very soon (2.82?). Right now I see no way of doing that, except through shader nodes directly (light path node tricks).
Depending on you requirements, you could build chromakey mattes assisted by cryptomatte masks. That would get you a pretty good result.
For a perfect solution you’d probably need multiple renders.
@Hadriscus My goal is to be able to change the color after the image is rendered, in case my client wants me to change the color of elements, so I wouldn’t have to re-render the whole scene.
So I’m actually not sure your shader solution would address that.
You probably can’t escape rendering multiple times. What to render is another story. I’d probably render the “original” and additional pass where object material is replaced with black diffuse. Subtracting this from original gives you light contribution of your object in all interactions, including bounce, reflection, refraction etc. Grade this intermediate result to taste and plus it back over the black element to get final modified render.