Jump to: Board index » General » Fusion

Newbie, edge halo/fringe with matted objects

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message
Offline

unmatic

  • Posts: 3
  • Joined: Mon Sep 13, 2021 10:55 pm
  • Real Name: Timothy Armstrong

Newbie, edge halo/fringe with matted objects

PostMon Sep 13, 2021 11:11 pm

Hey!

Brand new user here. The main reason I'm trying fusion is to avoid the annoying edge artifacts when i separate elements of a render that after effects gave me, but was told fusion does not suffer from that.

But I seem to have the same issue in fusion.
What am I doing wrong?
Please keep in mind i have constructed this purely to see if the issue exists, I realise its not how you would normally comp things together.

For my test i rendered a simple scene, and have matted out each element, (merging them together) then placed a black Background behind.
You can clearly see the black BG peaking through the gap in between the objects.
Same issue I had in after effects.

Have I constructed this incorrectly? Images attached.

Many thanks!

Tim
Attachments
Edge halo image2.PNG
node graph
Edge halo image2.PNG (50.63 KiB) Viewed 1064 times
Edge halo image1.PNG
Showing the edge
Edge halo image1.PNG (361.1 KiB) Viewed 1064 times
Offline
User avatar

Chad Capeland

  • Posts: 3017
  • Joined: Mon Nov 10, 2014 9:40 pm

Re: Newbie, edge halo/fringe with matted objects

PostTue Sep 14, 2021 12:21 am

The beauty passes are probably premultiplied. Better approach would be to copy the matte to the alpha channel and then merge. You could also try changing the SubtractiveAdditive mode.
Chad Capeland
Indicated, LLC
www.floweffects.com
Offline

unmatic

  • Posts: 3
  • Joined: Mon Sep 13, 2021 10:55 pm
  • Real Name: Timothy Armstrong

Re: Newbie, edge halo/fringe with matted objects

PostTue Sep 14, 2021 12:48 am

using the puzzle matte in the beauty pass's alpha channel did the trick!
Thanks Chad!
Offline
User avatar

Bryan Ray

  • Posts: 2478
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: Newbie, edge halo/fringe with matted objects

PostTue Sep 14, 2021 12:56 am

When you matte out objects in that fashion, they should be recombined using an Add operation instead of a Merge. To demonstrate, here's a very simple setup (just copy the code and paste it into your node graph. The tools will appear):

Code: Select all
{
   Tools = ordered() {
      Background1 = Background {
         Inputs = {
            GlobalIn = Input { Value = 1, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            Depth = Input { Value = 3, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input { Value = 1, },
            TopLeftGreen = Input { Value = 1, },
            TopLeftBlue = Input { Value = 1, },
            EffectMask = Input {
               SourceOp = "Rectangle1",
               Source = "Mask",
            }
         },
         ViewInfo = OperatorInfo { Pos = { 605, 148.5 } },
      },
      Background1_1 = Background {
         Inputs = {
            ApplyMaskInverted = Input { Value = 1, },
            GlobalIn = Input { Value = 1, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            Depth = Input { Value = 3, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input { Value = 1, },
            TopLeftGreen = Input { Value = 1, },
            TopLeftBlue = Input { Value = 1, },
            EffectMask = Input {
               SourceOp = "Rectangle1",
               Source = "Mask",
            }
         },
         ViewInfo = OperatorInfo { Pos = { 605, 214.5 } },
      },
      Rectangle1 = RectangleMask {
         Inputs = {
            Filter = Input { Value = FuID { "Box" }, },
            SoftEdge = Input { Value = 0.0641, },
            MaskWidth = Input { Value = 1920, },
            MaskHeight = Input { Value = 1080, },
            PixelAspect = Input { Value = { 1, 1 }, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Center = Input { Value = { 0.18574297188755, 0.5 }, },
            Width = Input { Value = 0.616465863453815, },
            Height = Input { Value = 1.5, },
         },
         ViewInfo = OperatorInfo { Pos = { 495, 148.5 } },
      },
      ChannelBooleans1 = ChannelBoolean {
         CtrlWZoom = false,
         Inputs = {
            Operation = Input { Value = 1, },
            Background = Input {
               SourceOp = "Background1_1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 770, 280.5 } },
      },
      Merge1 = Merge {
         Inputs = {
            Background = Input {
               SourceOp = "Background1_1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 770, 214.5 } },
      }
   }
}



If you turn on the Waveform SubView, you can see the slope created by the blurred alpha:


Capture.JPG
Capture.JPG (93.59 KiB) Viewed 1031 times



Looking at the result of the Merge, you'll see the trough, just like with your example image:


Capture2.JPG
Capture2.JPG (25.46 KiB) Viewed 1031 times



This happens because during a Merge operation, the alpha of the Foreground is used to "punch a hole" in the Background, and then the two parts of the image are added together. In this case, you've done the hole punching yourself ahead of time, so the background is being darkened a second time during the Merge.

Knowing that you've already made the hole due to the way you've segmented the image, you can instead simply add the two parts together (see the ChannelBooleans tool) to get the result you expected, without the trough:


Capture3.JPG
Capture3.JPG (33.03 KiB) Viewed 1031 times



Notice that even though I'm adding two images together, the waveform shows that it never goes above 100% (1.0).
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

unmatic

  • Posts: 3
  • Joined: Mon Sep 13, 2021 10:55 pm
  • Real Name: Timothy Armstrong

Re: Newbie, edge halo/fringe with matted objects

PostTue Sep 14, 2021 1:08 am

Brian thank you!
I thought i had it fixed but was wrong.
This makes sense and works a treat.
Thanks for the breakdown!
Offline

Hendrik Proosa

  • Posts: 3015
  • Joined: Wed Aug 22, 2012 6:53 am
  • Location: Estonia

Re: Newbie, edge halo/fringe with matted objects

PostTue Sep 14, 2021 7:27 am

In some softwares the merge operation meant for specifically merging this kind of matted elements is called disjoint-over and has this expression: A+B(1-a)/b, A+B if a+b<1. Small letters denote alpha channels of inputs and big letters RGB values. It should be very straightforward to build this expression in Fusion too.
I do stuff.
Offline
User avatar

Bryan Ray

  • Posts: 2478
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: Newbie, edge halo/fringe with matted objects

PostTue Sep 14, 2021 9:14 pm

I've seen that formula before, notably in the Nuke docs, but I've never been able to make sense of it. If you divide by the background alpha (in Nuke parlance, A is over B), then in places where the alpha is dropping toward zero, your background RGB shoots up toward infinity. The numerator portion is just the typical Over, which is what I'd expect. I have no idea what the division is supposed to be accomplishing.
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

Hendrik Proosa

  • Posts: 3015
  • Joined: Wed Aug 22, 2012 6:53 am
  • Location: Estonia

Re: Newbie, edge halo/fringe with matted objects

PostWed Sep 15, 2021 7:44 am

That formula should have one little bit added, if b is 0, output A, to avoid division by zero.

Otherwise it works, because the B*(1-a)/b part assumes premultiplied RGB values, meaning that from unpremulted perspective (lets denote it uB) it is uB*b*(1-a)/b == uB*(1-a), which in turn is the second half of simple over. The implicit multiplication with b prevents the shoot to infinity because it cancels out division with b. Division is restoring the original B value, doing an unpremult, so in essence this equation recreates B and then does a simple over with A.
I do stuff.
Offline
User avatar

Bryan Ray

  • Posts: 2478
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: Newbie, edge halo/fringe with matted objects

PostWed Sep 15, 2021 4:15 pm

Ah! Yes, I'd missed that B is actually B*b, which cancels 1/b. Okay, confusion cleared; thanks!
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com

Return to Fusion

Who is online

Users browsing this forum: No registered users and 44 guests