Area :: Header
Interested in making Indie games?

Register for a Meet the Experts webinar with Digital-Tutors today!
Discussion Groups

General Discussion

Reply
Active Member
Dark Spark Jamie
Posts: 6
Registered: ‎05-21-2012

Premultiply Without Halo?

405 Views, 20 Replies
05-21-2012 06:46 AM
Received CG elements from client rendered over white with embedded alpha. New to smoke, normally I would bring this into After Effects and set to premultiply and choose white as the background color. The result is a shadow with no halo when comped over black (or any other color). Trying to get the same result in Smoke. Using a blend and comp node in the modular keyer gets me closer, but I still have a gray halo around the shadow. Obviously I could render it out of After Effects and bring it into Smoke, but it seems like I shouldn't have to do that.

Any suggestions?

Please use plain text.
*Expert Elite*
*Expert Elite*
BKM
Posts: 3,416
Registered: ‎07-22-2003

Re: Premultiply Without Halo?

05-21-2012 06:57 AM in reply to: Dark Spark Jamie
You can add a Logic Op set to Divide with you Fill and matte as inputs. The output would then be your new fill.

IN Action there is a DIVIDE check box in the media list.

In Axis you can adjust the Blend Curve by moving the left side of the curve to the top of the graph

Senior Flame/Smoke Editor WTHR-TV
Check out the Premiumbeat Smoke Blog
http://www.premiumbeat.com/blog/category/smoke-2/
Please use plain text.
Active Member
Dark Spark Jamie
Posts: 6
Registered: ‎05-21-2012

Re: Premultiply Without Halo?

05-21-2012 07:17 AM in reply to: Dark Spark Jamie
Thanks for the quick response Brian. First I brought in the fill/matte in action and checked divide and it looks worse (see attached). Then I tried the Logic Op in Modular Keyer, and when I set the blending mode to divide, it disappeared (see attached). Lastly, I tried it in axis, but couldn't find the blend curve you referenced. No doubt I'm probably doing something wrong. Any ideas?

Please use plain text.
*Expert Elite*
*Expert Elite*
BKM
Posts: 3,416
Registered: ‎07-22-2003

Re: Premultiply Without Halo?

05-21-2012 07:58 AM in reply to: Dark Spark Jamie
Pipe the FILL into the FRONT and the MATTE into the BACK (green). It's really just input A and B. But you may get the same result as Action since it will pull from the white in the main image.

Senior Flame/Smoke Editor WTHR-TV
Check out the Premiumbeat Smoke Blog
http://www.premiumbeat.com/blog/category/smoke-2/
Please use plain text.
Active Member
Dark Spark Jamie
Posts: 6
Registered: ‎05-21-2012

Re: Premultiply Without Halo?

05-21-2012 08:39 AM in reply to: Dark Spark Jamie
Yeah, see that's the problem. In After Effects it won't pull any white from the background, which gives me a clean black shadow with no halo.
Is there a way to get that same result in Smoke?
Please use plain text.
*Expert Elite*
*Expert Elite*
BKM
Posts: 3,416
Registered: ‎07-22-2003

Re: Premultiply Without Halo?

05-21-2012 12:11 PM in reply to: Dark Spark Jamie
Hmmm. I have been unsuccessful with my tests. I fit's rendered over black from the start then divide would work. But the full white frame messes up the math.

Senior Flame/Smoke Editor WTHR-TV
Check out the Premiumbeat Smoke Blog
http://www.premiumbeat.com/blog/category/smoke-2/
Please use plain text.
*Expert Elite*
*Expert Elite*
BKM
Posts: 3,416
Registered: ‎07-22-2003

Re: Premultiply Without Halo?

05-21-2012 02:24 PM in reply to: Dark Spark Jamie
I think I have it... try XNOR in the logic op.


Senior Flame/Smoke Editor WTHR-TV
Check out the Premiumbeat Smoke Blog
http://www.premiumbeat.com/blog/category/smoke-2/
Please use plain text.
Distinguished Contributor
ABC_CNG
Posts: 148
Registered: ‎10-05-2009

Re: Premultiply Without Halo?

05-21-2012 02:37 PM in reply to: Dark Spark Jamie
I have the answer for you guys. The problem with doing a straight divide is it will only work with images premultiplied over black, i.e. zero. Your image is premultiplied over white, i.e. value of 1.

John Montgomery of fxguide gave a master class at NAB several years ago on custom nodes. He created a node to solve for this exact issue. In fact, his formula works for images premultiplied over any color, not just white.

The formula is RGB-((1-alpha)*bg). RGB is the fill premultiplied over color background. bg is the background color.

Take a frame of white(that's the 1) and subtract the alpha using a logic op. Then multiply by the background color using another logic op. Subtract that from the original premultiplied fill using a third logic op. Voila, you now have a new fill premultiplied over black which you can divide by the alpha using a fourth logic op. Now you have your "straight" un-premultiplied fill.

This four logic-op batch can be saved and recalled as needed, or saved as a custom node.

Here is a link to John's class: http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=10120873 Then click on view now next to his picture, then open the folder Flame 2007, John Montgomery, Using quick nodes.

I hope this helps.
Steve Beecher
Flame Artist
Disney ABC Television
Please use plain text.
*Expert Elite*
*Expert Elite*
BKM
Posts: 3,416
Registered: ‎07-22-2003

Re: Premultiply Without Halo?

05-21-2012 04:35 PM in reply to: ABC_CNG
Well leave it to John Montgomery. And thanks for the follow up. Obviously the next point in question is why it takes 4 Logic Ops to do what AE does in 1 check box click. But I do appreciate the math.:smileyhappy:

Senior Flame/Smoke Editor WTHR-TV
Check out the Premiumbeat Smoke Blog
http://www.premiumbeat.com/blog/category/smoke-2/
Please use plain text.
Distinguished Contributor
ABC_CNG
Posts: 148
Registered: ‎10-05-2009

Re: Premultiply Without Halo?

05-21-2012 06:14 PM in reply to: Dark Spark Jamie
Two words; "feature request". I remember the days when you didn't even have the divide option in either action or in the logic op. You had to use a Sapphire math op to divide.
Steve Beecher
Flame Artist
Disney ABC Television
Please use plain text.