The Nuke node (DeepHoldout) works with deep images but outputs only flat
images. looks like it merges and flattens A and B together, ignoring RGB
channels for B.
Does it make sense for a holdout sample to affect all subsequent samples in
the stack?
It should affect the accumulated opacity along the stack, but because its
opacity should be imputed to the next source sample (that sample might be
far away, but lets keep things simple)
And since we know how to comp one or more holdout samples on top of a
source sample:
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'.rgb = *0 +* (1 - holdout_alpha) * S.rgb
S'.alpha = *holdout_alpha +* (1 - holdout_alpha) * S.alpha
copy S' to result image
* holdout_alpha = 0*
I think that will work,
r
On Thu, Jun 29, 2017 at 6:25 PM, Larry Gritz <[email protected]> wrote:
> 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
>
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org