It's more difficult than it initially seems.. The obvious thing is to use the DeepMerge set to holdout to punch a hole in your A input, invert the matte and punch the inverse hole in the B input.. but when you merge these you get the dark fringing where your matte is semi-transparent, which is the same problem solved by adding the two images together, or using the disjoint-over
..but, you inherently cannot do that with deep samples - when the deep image is flattened, all the samples for a pixel are over'd. There is a DeepKeyMix gizmo on Nukepedia, but it is very destructive - it flattens the image with DeepToImage, applies a regular KeyMix and then uses the DeepRecolour.. which is probably okay if you are only rendering deep-opacity, but bad if you are rendering deep-RGB. I had a rough idea of how to write a plugin to mix between two deep images, but haven't got around to implementing it.. so.. there might be some other fundamental flaw in the approach, but.. For two inputs "A" and "B": If all the samples are at the "same depth" in both A and B, easy, the output samples are a simple mix between each sample of A and B. This is the case for, say, keymixing in a DeepColorCorrect (where only the existing sample values will be changed) If the samples are not aligned, things are more complicated (e.g mixing two separate renders). For each sample you need to make a corresponding sample at the same depth in the other image, by interpolating between the nearest two samples. In other words, if you have two images like this: A samples: empty empty red empty black B samples: empty empty blue blue blue 1) For first two empty samples, nothing is done 2) For the A:red and B:blue sample pair, output sample is a simple mix 3) For the A:empty and B:blue sample pair, insert a sample in A which is a mix between the "red" and "black" samples. Then mix between that and B's blue sample I think the case which would cause artefacts is when your samples have large distance-gaps between them: like keymixing between a foreground tree and the sky - the process of creating the new samples will create "tree" coloured samples at the "sky" depth and vice-versa - Ben On 17/06/14 12:40, Frank Rueter|OHUfx wrote: > Hi peeps, > > I'm just trying to figure out how to merge two deep images based on a > deep mask channel, without getting fringing. > Been playing with DeepExpression but don't know if I can reference > samples in there (the documentation is rather sparse to say the least). > Basically I need a true, volumetric DeepKeyMix. > > Any ideas? > > Cheers, > frank > > -- > ohufxLogo 50x50 <http://www.ohufx.com> *vfx compositing > <http://ohufx.com/index.php/vfx-compositing> | *workflow customisation > and consulting <http://ohufx.com/index.php/vfx-customising>* * > > > > _______________________________________________ > Nuke-users mailing list > Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users > -- ben dickson 2D TD | ben.dick...@rsp.com.au rising sun pictures | www.rsp.com.au _______________________________________________ Nuke-users mailing list Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users