Disjoint-over & Conjoint-over

I recently stumbled upon these two operations in Nuke’s merge node and starting looking into them and found this site describing when you’d want to use them.

Long story short, if 3D is giving you passes where other objects have been held-out, you often will get fringing even if you un-premult your front. I’ve run into this issue enough to want to find a solution. Before I attempt writing a shader (it’s been ages so despite the math being simple it’ll probably take me ages) I wanted to ask if anyone knew of how to replicate the math with the tools we already have.



The disjoint-over has a bit more happening as there’s some conditional math going on. I’ll keep trucking along and see if I can manage to write a shader.