Community
Smoke Forum
Welcome to Autodesk’s Smoke Forums. Share your knowledge, ask questions, and explore popular Smoke topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Premultiply Without Halo?

23 REPLIES 23
Reply
Message 1 of 24
Anonymous
2424 Views, 23 Replies

Premultiply Without Halo?

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?

23 REPLIES 23
Message 2 of 24
BKM
Advisor
in reply to: Anonymous

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

Flame/Smoke Editor
Check out the Premiumbeat Smoke Blog
http://www.premiumbeat.com/blog/category/smoke-2/
Message 3 of 24
Anonymous
in reply to: Anonymous

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?

Message 4 of 24
BKM
Advisor
in reply to: Anonymous

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.

Flame/Smoke Editor
Check out the Premiumbeat Smoke Blog
http://www.premiumbeat.com/blog/category/smoke-2/
Message 5 of 24
Anonymous
in reply to: Anonymous

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?
Message 6 of 24
BKM
Advisor
in reply to: Anonymous

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.

Flame/Smoke Editor
Check out the Premiumbeat Smoke Blog
http://www.premiumbeat.com/blog/category/smoke-2/
Message 7 of 24
BKM
Advisor
in reply to: Anonymous

I think I have it... try XNOR in the logic op.


Flame/Smoke Editor
Check out the Premiumbeat Smoke Blog
http://www.premiumbeat.com/blog/category/smoke-2/
Message 8 of 24
ABC_CNG
in reply to: Anonymous

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
Message 9 of 24
BKM
Advisor
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.:)

Flame/Smoke Editor
Check out the Premiumbeat Smoke Blog
http://www.premiumbeat.com/blog/category/smoke-2/
Message 10 of 24
ABC_CNG
in reply to: Anonymous

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
Message 11 of 24
Anonymous
in reply to: Anonymous

Thank you for this very informative thread. I'm coming from After Effects and Fusion and things like premultiplication in Smoke was a head scratcher.
Message 12 of 24
Anonymous
in reply to: Anonymous

Ok, I watched the video and set it all up. I'm using smoke on mac, so instead of true "batch" I'm using the modular keyer to do all logic ops (math). My problem is I can't simply add an output node to get the result out. I have to use this "result" node.

When I try to connect it to the result node I get nothing, so I'm stuck. I'm sure I am just doing something wrong, but I can't figure out what. See attachment for details.

Thanks!

Message 13 of 24
BKM
Advisor
in reply to: Anonymous

Are you getting the proper results inside of each logic op? F4. When I created it, I had to "swap sources" on the first node, as logic ops have had a change that makes it matter what order things are piped.

Flame/Smoke Editor
Check out the Premiumbeat Smoke Blog
http://www.premiumbeat.com/blog/category/smoke-2/
Message 14 of 24
Anonymous
in reply to: Anonymous

After watching the John Montgomery video and working with our Flame artist, we've finally cracked it. Screen shot attached. Glad I can save the setup so it can be easily applied to all the other shots that were rendered the same way.

Thanks for the help guys!

Message 15 of 24
Anonymous
in reply to: Anonymous

Two words; "feature request".


Maybe in the not too distant future it could be this easy? (see attached).

Message 16 of 24
peppermintpost
in reply to: Anonymous

well the function in flame is as easy as in after effects, you only need to understand the basics
of compositing. you only need to premultiply your image with your alfa before you use the key.
flame has no premultiply button, so what you need to do is use logic ops and multiply.
premultiply is exactly what it says first multiply it with your alfa before you key it.

the fun thing is, that in your case it will not work coz the shaddow is not matching your alpha channel. where ever you are on your alf the result of alpha plus front should be 1 in luma.
when you check your values it is not. it is slightly off. thats why you see this halo.
smoke/flame/nuke or shake are doing everything correctly when they display a halo.
i cant try in after effects coz i dont care about ae, but i ve tried in all the other software packages.

so as usual - if there is a problem with flame it is mostly sitting in front of it.
😉
Message 17 of 24
ihabs
in reply to: peppermintpost

Hi Guys

 

I have one question , what about if I need to export something from Smoke with straight alpha so that other softwares can use it without getting that black edge , like a graphics element or a logo from connectFX ? 

 

Thanks,

Message 18 of 24
BKM
Advisor
in reply to: ihabs

Divide it first with a logic Op before the CFX output.


Flame/Smoke Editor
Check out the Premiumbeat Smoke Blog
http://www.premiumbeat.com/blog/category/smoke-2/
Message 19 of 24
ihabs
in reply to: Anonymous

Thanks , it works.

Message 20 of 24
sebastienleclercq
in reply to: Anonymous

Quick question about John Montgomery's pipeline:

the very first Logic Op (for which he uses the Color Correct Node in the end) is used the Substract the Matte from a full white Fill, which results in a negative view of the Matte... So my question is, instead of using a Logic Op, can't i simply use a Negative Node after the Matte, which will give the exact same result?

I'm asking because I don't know if the Logic Op actually does something else than simply creating a Negative view of the Matte in terms of Mathematics?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report