Problem with alpha channel while compositing

Hi everyone

I’m having sort of a headache with something that seems pretty simple but I can’t figure it out for some reason.

Let’s say I have this gabion I have to render

The metal cage is on one layer. The stones inside are another one.

The reason I separated these two is I want my client to be able to edit the color of the stones in Ps or similar if they need to afterwards. So my goal is to deliver the cage layer on one hand, and the stones on the other hand.

If I render the two layers separately and check the way they blend in the compositor with an alpha over node, I get this:

As you can see, there is a fringe on the first layer, which will become a problem afterwards.

If I change the alpha over node to disjoint over, I get a good result, no fringe anymore

I can export this picture as a png or tiff, in Affinity the result looks pretty good, no transparency issue

But my goal was to have two layers, and when I export each layer as an independent png or tiff, and composite them in Affinity, the ugly fringe is back. Look at the red all around the metal rods

So my question is, how can I export the two layers independently and get the same result in Affinity than with the alpha over node set to Disjoint over in the compositor ?

Thanks in advance for your answers

Cheers

Well, I suppose you have the stones with some cuts from the grid.
Ideally you should have the stones with the shadows of the grid (indirect contribution) and the grid with the stone as a holdout like you did.

This kind of situation are logical in those areas where the two images should merge : it’s impossible to come up with something that will add up perfectly.

There are some ways to salvage that in comp, that is remove transparency in those areas for one layer and having the other on top, maybe this is what the disjoint over is doing…

But in your case since you have access to the scene you just need to render the image with the appropriate viewlayer settings !

Thanks you nailed it ! Both layers were set to holdout so yeah, I tested it and it works just fine now.
Thanks again