PDA

View Full Version : Premutliply, or not to premultiply (for comping in Nuke)


JasonA
11-28-2008, 08:20 PM
Hi all,

Im undecided to how to best render out my footage (from maya) for composting in Nuke. Is it best to set the maya framebuffer to premultiply the footage when rendering out elements for comp? I always used to turn it off for working in AE, but im hearing different people telling me different things about footage in Nuke. Some are saying its best to premultiply, and some are telling me not, so im a bit confused. And my render jobs take to long to do over... Im inclined to sill turn it off as to avoid matte lines.. Can someone chime in on this for me?

Cheers,

wrosecrans
11-28-2008, 10:58 PM
Premultiplied is the standard way to get CG. Otherwise, getting glowing elements and lens flares and whatnot is a royal PITA. Turning off premultiplication doesn't avoid matte edge artifacts. Not handling premultiplication correctly is what causes them. You can still get all sorts of compositing artifacts with unpremultiplied sources if you handle it wrong.

Redsand1080
11-29-2008, 05:16 PM
To the best of my knowledge if you want to color correct you should turn off premultiply when you render...then do your color corrections, then premultiply by the alpha channel in post. This is for 16 bit and lower images so you don't change the values in the color channel and get them out of sync with your alpha...which you will ultimately do if you color correct a pre-multiplied image.

This is because the values in your color channel where they are semi-tranparent have been multiplied by your background color in both the alpha and color channels so they match each other. If you change the luminance values in the color channel, but not in the alpha, they no longer work together correctly. But if you don't pre multiply all you have is pure color value in your color channel, so you can change it as much as you want with no fear of messing up your alpha info.


Hope that helps. :thumbsup:

JasonA
11-29-2008, 06:42 PM
Great thanks for the input guys, both helped alot. Redsn1080, let me ask oyu one last thing. I will be color correcting to footage slightly, so should I do the premultiply when i bring the footage into nuke (interpreting), or should I apply it as a mask at the end of my color correcting "tree" in my comp?

wrosecrans
11-29-2008, 06:55 PM
A - Color correction should normally happen when the footage is not multiplied.

B - One tiny little semantic trick to help make this seem slightly simpler - ignore the "pre-" in "premultiplied." It's no longer useful to you once you get into Nuke and you can multiply it and divinde it willy nilly however it suits you.
It's not "pre-" anything since you are doing it whenever you need to. "Pre" implies that it always happened before you got involved, but that need not be the case.
Unfortunately, the node in Nuke is called "Premult" but I much prefer the phrasing in shake of simply "MMult" and "MDiv" - Matte Multiply and Matte Divide.

It's an absurdly slight change in phrasing, but when I started using Shake, it all amde sense to me when I started talking in terms of "I'll multiply it now" and "I need to divide it now." "Unpremultiply" is so much longer of a word than "divide" that you sort of get lost in prefix hell and lose what you are actually doing. So don't never not fail not to disuse extra prefixes which can't be said not to be completely unneeded.

JasonA
11-29-2008, 08:52 PM
LOL.. that last line was awesome. Thanks Will, you've made it much more clear!

Redsand1080
11-30-2008, 04:47 PM
Yea definitely apply it afterwards. I haven't used that software so I'm assuming its like AE where it asks you to interpret the alpha right off the bat. So render it out as straight, bring it in as straight...then 'multiply' it by the alpha afterwards. Then all your values in the alpha and color channels along your antialised edges should match up nicely! Which is really all the end goal is, matching values...it's just a bunch of confusing mess in order to make that happen.


Good luck!

Makaze
12-02-2008, 07:04 PM
Ok, Im a little bit confused here. Seems like the initial question was regarding rendering out from Maya, while the main discussion is about premulting/unpremulting for CC.

Regarding CC, yes, always unpremult and then premult after CC (I guess there could be an exception, but none that I can think of right now). Either add nodes before and after the CC, or there should actually be a checkbox for it in the CC node itself (Nuke). This allows for a cleaner script, but can also be risky, since you have to look in the node to know if its enabled or not.

Regarding rendering out from Maya, I'd like to know this as well. I'd assume the best would be to render out unpremulted, just to avoid any possible artifacting and render errors, and then manually multiply it in comp.

Aneks
12-02-2008, 11:49 PM
Regarding CC, yes, always unpremult and then premult after CC (I guess there could be an exception, but none that I can think of right now). Either add nodes before and after the CC, or there should actually be a checkbox for it in the CC node itself (Nuke). This allows for a cleaner script, but can also be risky, since you have to look in the node to know if its enabled or not.

Regarding rendering out from Maya, I'd like to know this as well. I'd assume the best would be to render out unpremulted, just to avoid any possible artifacting and render errors, and then manually multiply it in comp.

All of the colour correct nodes in Nuke let you specify the premultiplication behavior so it is not an issue which way you render. Just like in most compositing apps the user can control this. You will not get errors unless you do something stupid like premultiply over a colour other than black !

Makaze
12-03-2008, 12:44 AM
All of the colour correct nodes in Nuke let you specify the premultiplication behavior so it is not an issue which way you render. Just like in most compositing apps the user can control this. You will not get errors unless you do something stupid like premultiply over a colour other than black !

Exactly. What I meant is that it's sometimes easier see whats going on by using separate nodes for premult/unpremult instead of selecting it in the CC node.

Regarding rendering errors, I was talking about rendering from Maya, not Nuke. Sorry if I was a bit unclear. As there should theoretically not be any errors when rendering out premulted images from Maya, I'm still a bit paranoid, and do think rendering out an unpremulted image is a bit safer, and then manually multiply it in comp.

beaker
12-09-2008, 05:34 PM
I'm still a bit paranoid, and do think rendering out an unpremulted image is a bit safer, and then manually multiply it in comp.just render premultiplied images. They work just fine in Nuke, Shake, DF, Toxik. The only application that people always seem to have issues with them is After Effects.

Redsand1080
12-09-2008, 06:27 PM
just render premultiplied images. They work just fine in Nuke, Shake, DF, Toxik. The only application that people always seem to have issues with them is After Effects. If you color correct 16 bit and lower images that are pre-multiplied by the backgrounc olor doesn't that offset your color channel values with your alpha channel values and make them out of sync?

beaker
12-09-2008, 08:30 PM
If you color correct 16 bit and lower images that are pre-multiplied by the backgrounc olor doesn't that offset your color channel values with your alpha channel values and make them out of sync?That's why you color correct it unpremultiplied which is very easy to do in node based compositors. PITA to do in AE though.

Redsand1080
12-10-2008, 01:25 PM
PITA to do in AE though.


No doubt! I've had nothing but trouble with that. That's the main reason I've been wanting to switch to node-based as opposed to layer-based.

CGTalk Moderation
12-10-2008, 01:25 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.