For regular 2D images, the "holdout" operation (or just "out" in Porter/Duff 
speak) is the compositing operation where (A out B) is that B blocks A by B's 
alpha amount, but it doesn't contribute any color or opacity of its own. That 
is, A with a B-shaped hole cut in it. If B has alpha=1, the resulting pixel 
will be completely transparent. If B has alpha=0.75, the result will have A, 
but with its color and opacity multiplied by 0.25.

We're on the same page, yes?

OK, so my real question is what the "deep holdout" operation actually does. If 
A is the "source" image, and B is the "holdout" image, we have the intuition 
that B's samples should block any farther samples of A, but without 
contributing samples itself.  But I'm having real trouble figuring out the 
correct behavior for a stack of interleaved A and B samples. Nuke supports a 
deep holdout operation, but the docs aren't specific about exactly what it does.

I've tried walking front to back, keeping an accumulated holdout alpha and 
multiplying by that as we copy source to result. Here's the sketch:

    holdout_alpha = 0    // accumulated holdout-ness
    walking near to far in the combined set of source and holdout samples:
        S = next closest sample
        if S from holdout:
            holdout_alpha += (1-holdout_alpha)*S.alpha
        else :  // S is from source image
            S' = S * (1-holdout_alpha)
            copy S' to result image

For a "flat-equivalent" image of one holdout sample closer than one source 
sample, it matches what I expect for the 2D flat holdout operation. But it 
doesn't seem to give me what I'm looking for in many circumstances involving 
multiple depth samples of the source.

Can somebody bail me out here and spell out what the correct behavior of a deep 
holdout operation ought to be?

--
Larry Gritz
[email protected]


_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to