Compositing Passes in Nuke, object going transparent


#1

I’ve just started learning Nuke recently, so I’ve been looking/reading a lot of tutorials on compositing render passes in. And while the general idea is straight forward, the specifics get a bit confusing as each different tutorial/author has their own method of doing things, so at this point, I’ve just been combining things I’ve learned here and there, and I don’t even know if I’m doing things correctly anymore.

For a practice scene, I shot a short clip on my camera, tracked it, and put in just a quick guitar model on the floor in Maya. Then I rendered out with 2 render layers (one for the guitar’s beauty, one for the shadow). Here is a screenshot of what I’ve put together in Nuke. I have the two EXR’s, one for the beauty pass and one for the shadow. When it’s just the two merged together, my image is fine, but once I add in my background images, my guitar’s alpha seems to be changing and it’s like transparent in areas?

I apologize in advance, I know I’m probably putting them together incorrectly or some other things are wrong. So… what do I do?

For reference, this is how it should be more like, from a master layer render:


#2

To me it seems, that the guitar uses the alpha from the shadow layer.
I would re-arrange the merging operations in the following way:

  1. Merge the shadow layer over the background plate.
  2. Put all the passes together, but don’t forget to insert an Unpremultiply after each read and a Premultiply at the end. Make sure that the Merges don’t modify the original guitar alpha.
  3. Merge the branch with the passes over the branch with the background plate and the shadow.

#3

Hey, thanks for the reply!

I had someone help me and they played around with my nuke file. What they came up with was something similar to what you wrote I think. What changed was:

Start with reading the guitar.exr. Shuffle node for each pass. However, the blue channel was set to alpha for some reason, so in each Shuffle, it was set to 0/black. Then the passes were merged like before. Another Shuffle node was created and linked to the original exr, and set all to alpha. Then, this new Alpha Shuffle node was linked with the Merged passes, with the Alpha Shuffle as 1 set to alpha, and the Merged Passes as 2 set to rgb.

The shadow was essentially merged over the background image, but he used a Color Correct node and Grade node to do it. Though this part I don’t quite understand yet. Then at the end, the Shuffle Copy with the guitar was merged over the Grade node that held the shadow + background.

A side question though, my image sequence doesn’t seem to be playing? It just stays on the first frame when I play?

EDIT: Okay, after hours of playing and messing around with things, it seems it has fixed itself…