Jump to: Board index » General » Fusion

Math Error When Merging Masks

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

David Stringham

  • Posts: 12
  • Joined: Tue Dec 02, 2014 3:50 pm
  • Location: Mendota, IL

Math Error When Merging Masks

PostTue Oct 06, 2015 2:06 am

What I'm trying to do is create a matte for lightwrap. As far as I can tell, I'm doing everything right. I've attached a screenshot illustrating my node setup and an image of my result.

I have the inverted, blurred matte, which I multiply with the original matte and get the incorrect result below. I have tried nearly all of the blending modes with no change. Is there any explanation for why this is not working?
Attachments
lightwrap_bad_matte.jpg
lightwrap_bad_matte.jpg (35.84 KiB) Viewed 1734 times
lightwrap_nodes.JPG
lightwrap_nodes.JPG (25.63 KiB) Viewed 1734 times
Offline
User avatar

Chad Capeland

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

Re: Math Error When Merging Masks

PostTue Oct 06, 2015 2:56 am

The blend modes apply to RGB, not Alpha.
Chad Capeland
Indicated, LLC
www.floweffects.com
Offline

David Stringham

  • Posts: 12
  • Joined: Tue Dec 02, 2014 3:50 pm
  • Location: Mendota, IL

Re: Math Error When Merging Masks

PostTue Oct 06, 2015 8:56 am

Okay, fine, but that IS the RGB output. I just added a ChannelBooleans tool in between the first Merge and the Blur to copy the alpha into the RGB channels. No luck.
Offline

Ivan Ivanov

  • Posts: 86
  • Joined: Tue Nov 11, 2014 11:16 am

Re: Math Error When Merging Masks

PostTue Oct 06, 2015 9:59 am

There are multiple ways of manipulating alpha channels, but using merge for that is not what you'd go for.

Here is two simple setups:

Code: Select all
{
   Tools = ordered() {
      Ellipse1 = EllipseMask {
         Inputs = {
            SoftEdge = Input { Value = 0.001, },
            MaskWidth = Input { Value = 1920, },
            MaskHeight = Input { Value = 1080, },
            PixelAspect = Input { Value = { 1, 1, }, },
            ClippingMode = Input { Value = FuID { "None", }, },
            Width = Input { Value = 0.208884305444963, },
            Height = Input { Value = 0.208884305444963, },
         },
         ViewInfo = OperatorInfo { Pos = { 149, 55, }, },
      },
      Background1 = Background {
         Inputs = {
            GlobalIn = Input { Value = 1, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2", }, },
            TopLeftGreen = Input { Value = 1, },
            Gradient = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0, 0, 0, 1, },
                     [1] = { 1, 1, 1, 1, },
                  },
               },
            },
            EffectMask = Input {
               SourceOp = "Ellipse1",
               Source = "Mask",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 252, 55, }, },
      },
      MatteControl1 = MatteControl {
         CtrlWZoom = false,
         Inputs = {
            Background = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            GarbageMatte = Input {
               SourceOp = "Bitmap1",
               Source = "Mask",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 534.868, 33.1141, }, },
      },
      Bitmap1 = BitmapMask {
         Inputs = {
            SoftEdge = Input { Value = 0.002, },
            MaskWidth = Input { Value = 1920, },
            MaskHeight = Input { Value = 1080, },
            PixelAspect = Input { Value = { 1, 1, }, },
            ClippingMode = Input { Value = FuID { "None", }, },
            Image = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 534.868, -74.8859, }, },
      },
      Bitmap3 = BitmapMask {
         Inputs = {
            SoftEdge = Input { Value = 0.005, },
            PaintMode = Input { Value = FuID { "Subtract", }, },
            MaskWidth = Input { Value = 1920, },
            MaskHeight = Input { Value = 1080, },
            PixelAspect = Input { Value = { 1, 1, }, },
            ClippingMode = Input { Value = FuID { "None", }, },
            Image = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            Low = Input { Value = 0.1, },
            EffectMask = Input {
               SourceOp = "Bitmap2",
               Source = "Mask",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 486.747, 285.196, }, },
      },
      Bitmap2 = BitmapMask {
         Inputs = {
            MaskWidth = Input { Value = 1920, },
            MaskHeight = Input { Value = 1080, },
            PixelAspect = Input { Value = { 1, 1, }, },
            ClippingMode = Input { Value = FuID { "None", }, },
            Image = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            High = Input { Value = 0.85, },
         },
         ViewInfo = OperatorInfo { Pos = { 399.203, 285.196, }, },
      },
   },
}
Offline
User avatar

Chad Capeland

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

Re: Math Error When Merging Masks

PostTue Oct 06, 2015 12:18 pm

David Stringham wrote:Okay, fine, but that IS the RGB output. I just added a ChannelBooleans tool in between the first Merge and the Blur to copy the alpha into the RGB channels. No luck.


Because the Bmp turned your RGBA image back into Alpha.
Chad Capeland
Indicated, LLC
www.floweffects.com
Offline

David Stringham

  • Posts: 12
  • Joined: Tue Dec 02, 2014 3:50 pm
  • Location: Mendota, IL

Re: Math Error When Merging Masks

PostTue Oct 06, 2015 3:07 pm

Ah, that had crossed my mind before I added the ChannelBool, but somehow I didn't make the connection to the one already on there. I switched the ChannelBool to after the Bitmap and nothing. So I got rid of both of the tools, added a ColorCurves, and inverted the values that way. Again, same result.

Any idea on how to get the matte into a form that Fusion will like?
Offline
User avatar

Chad Capeland

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

Re: Math Error When Merging Masks

PostTue Oct 06, 2015 7:45 pm

So your two images are both R=G=B, A=1, and you set the ApplyMode to Multiply? That works for me.
Chad Capeland
Indicated, LLC
www.floweffects.com

Return to Fusion

Who is online

Users browsing this forum: bentheanimator, Tomek Kosiorek and 30 guests