Jump to: Board index » General » Fusion

How to use effect node to mask another effect node?

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

George Woods

  • Posts: 36
  • Joined: Fri Aug 28, 2015 1:33 am

How to use effect node to mask another effect node?

PostMon Nov 01, 2021 12:32 am

For example - if I wanted to use a Ripple effect node to mask a Hue node.

I've been trying and reading, but I still can't get a result. I've tried connecting the output of the Ripple to the Mask of the second effect. I've tried changing the Blend settings for the first node as well.
I've tried adding a mask node between them.

I thought about just creating a ripple effect on a background colour node instead of my Media In node, and then creating an Alpha channel clip by rendering that and bringing it back in as a mask. But as soon as I disconnect the Media In node from the Ripple effect and put a background color node there - I suddenly get no animation from my Ripple Effect anymore!

I'm stumped, any help would be greatly appreciated.
Offline
User avatar

TheBloke

  • Posts: 1905
  • Joined: Sat Nov 02, 2019 11:49 pm
  • Location: UK
  • Real Name: Tom Jobbins

Re: How to use effect node to mask another effect node?

PostMon Nov 01, 2021 10:39 am

Any node can be the mask for any other node: you can pass any node into the blue Effect Mask input of any other:
Image

When the effect mask input is connected to a non-mask node, some options appear in that node's Settings tab, controlling how it should be masked:
Image

The default is to mask using the alpha channel of the node connected to the Effect Mask input, but you can also tell it to use Luminance, any individual RGB channel, and various other options:
Image

Using the output of the Ripple effect from MediaIn1 as a mask is unlikely to work. Doing that you would be trying to mask not only from the ripple, but also the whole original image. Some Fusion nodes have an option to only output the effect of the node, and not the input as well. For example the Highlight node has a "Merge Over" tickbox which, if unticked, outputs only the highlight itself. That allows you to do the merging of the highlight over the source material yourself, with a Merge node, and would make it easy to use the highlight itself as a mask or whatever else you wanted to do. Ripple does not have that option.

So you were correct in thinking that you should separate the ripple effect, by overlaying it over a Background.

Ripple is designed to distort the underlying image, and it can optionally also output a "Shine" which highlights those ripples with a white highlight effect.

Here's a node effect which might achieve what you want, or get you closer to it at least:
Image

First there's a Background with RGBA = 0, so it's completely transparent. Connected to that is a Ripple effect, with Shine enabled. This is also animated by keyframing Speed from 0 to 3.0 over 135 frames. I've set up two Ripples here, in some random pattern as I don't know specifically what effect you're going for:
Image

The output of Ripples1 is just the shine over a transparent background, as there's no image for it to distort underneath:
Image

Then MediaIn1 goes to an Instance of Ripples1. In the Instance I've de-instanced the Shine tickbox and turned that off. All other parameters are still instanced and therefore the same as Ripples1. The result of that is that MediaIn1 gets distorted (rippled) by the instance of Ripple1, but it does not get a shine effect. The rippled MediaIn1 then goes to a HueCurves node, which is Effect Masked by Ripples1, meaning that the HueCurves adjustments are only seen where the ripples are.

In summary we're using one Ripples to get the rippling effect on MediaIn1, then we're using another instance of Ripples outputting a shine highlight in the same pattern and with the same animation, and that shine highlight is used as the mask for HueCurves. Whatever adjustments HueCurves makes will only appear in the shape of the ripples.

The strength of Ripples' shine is controlled by the Strength slider, which in this example I have set to 0.417. That means the RGBA values output by Ripples1 are also 0.417. So anything masked by that will not be fully opaque. In other words, we're only seeing about 40% of the HueCurves1 effect, because Ripples1's strength is only about 40% (0.417). If you wanted a stronger HueCurves effect, you could increase Ripples1's strength. You also have the Low and High sliders in the Settings tab of HueCurves1, which allow for adjusting the strength of the incoming Effect Mask input. For example, if we set High to 0.4 then that would give a fully opaque HueCurves1 effect, even though Ripples1 is only outputting 0.417 in its alpha values. That can be useful in situations where you don't want to adjust the masking node (Ripples1) itself, but do want a stronger or weaker mask.

I don't know if all this is what you were going for, but maybe it will get you going on the effect you want.

Here are the nodes I created as code. You can copy this text and then paste it into Fusion to recreate all the nodes I made, except MediaIn1 and MediaOut. Then just connect them to your MediaIn and MediaOut nodes:
Code: Select all
{
   Tools = ordered() {
      HueCurves1 = HueCurves {
         CtrlWZoom = false,
         Inputs = {
            EffectMask = Input {
               SourceOp = "Ripples1",
               Source = "Output",
            },
            EditHue = Input { Value = 1, },
            EditRed = Input { Value = 1, },
            EditGreen = Input { Value = 1, },
            EditBlue = Input { Value = 1, },
            Hue = Input {
               SourceOp = "HueCurves2Hue",
               Source = "Value",
            },
            Sat = Input {
               SourceOp = "HueCurves2Sat",
               Source = "Value",
            },
            Lum = Input {
               SourceOp = "HueCurves2Lum",
               Source = "Value",
            },
            Red = Input {
               SourceOp = "HueCurves2Red",
               Source = "Value",
            },
            Green = Input {
               SourceOp = "HueCurves2Green",
               Source = "Value",
            },
            Blue = Input {
               SourceOp = "HueCurves2Blue",
               Source = "Value",
            },
            RedSuppress = Input {
               SourceOp = "HueCurves1Red",
               Source = "Value",
            },
            GreenSuppress = Input {
               SourceOp = "HueCurves1Green",
               Source = "Value",
            },
            BlueSuppress = Input {
               SourceOp = "HueCurves1Blue",
               Source = "Value",
            },
            Input = Input {
               SourceOp = "Instance_Ripples1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1045, 181.5 } },
         Tools = {
            HueCurves1Red = LUTBezier {
               SmoothEndsTransition = true,
               KeyColorSplines = {
                  [0] = {
                     [0] = { 1, RH = { 0.333, 1 } },
                     [1] = { 1, LH = { 0.667, 1 }, RH = { 1.333, 1 } },
                     [2] = { 1, LH = { 1.667, 1 }, RH = { 2.333, 1 } },
                     [3] = { 1, LH = { 2.667, 1 }, RH = { 3.333, 1 } },
                     [4] = { 1, LH = { 3.667, 1 }, RH = { 4.333, 1 } },
                     [5] = { 1, LH = { 4.667, 1 }, RH = { 5.333, 1 } },
                     [6] = { 1, LH = { 5.667, 1 } }
                  }
               },
               SplineColor = { Red = 204, Green = 102, Blue = 102 },
            },
            HueCurves2Sat = LUTBezier {
               SmoothEndsTransition = true,
               KeyColorSplines = {
                  [0] = {
                     [0] = { 1, RH = { 0.068863131049101, 1 } },
                     [0.2067] = { 1.50267379679144, LH = { 0.137769026762126, 1.50267379679144 }, RH = { 0.471097089812951, 1.50267379679144 }, Flags = { LockedX = true, Picked = true } },
                     [1] = { 1, LH = { 0.735863131049101, 1 }, RH = { 1.36409727626459, 1 } },
                     [2.09338521400778] = { 1.87700534759358, LH = { 1.72928793774319, 1.87700534759358 }, RH = { 2.37196498054475, 1.87700534759358 } },
                     [2.92996108949416] = { 1, LH = { 2.6513813229572, 1 }, RH = { 3.27850972762646, 1 } },
                     [3.97665369649805] = { 0.989304812834225, LH = { 3.65254146164211, 0.966915666160345 }, RH = { 4.31361866826322, 1.01258180569493 } },
                     [5] = { 1, LH = { 4.65922568093385, 1 }, RH = { 5.333, 1 } },
                     [6] = { 1, LH = { 5.667, 1 } }
                  }
               },
               SplineColor = { Red = 204, Green = 204, Blue = 0 },
            },
            HueCurves2Green = LUTBezier {
               SmoothEndsTransition = true,
               KeyColorSplines = {
                  [0] = {
                     [0] = { 1, RH = { 0.333, 1 } },
                     [1] = { 1, LH = { 0.667, 1 }, RH = { 1.36409727626459, 1 } },
                     [2.09338521400778] = { 1.87700534759358, LH = { 1.72928793774319, 1.87700534759358 }, RH = { 2.39528793774319, 1.87700534759358 } },
                     [3] = { 1, LH = { 2.69809727626459, 1 }, RH = { 3.3485486381323, 1 } },
                     [4.04669260700389] = { 0.989304812834225, LH = { 3.69814396887159, 0.989304812834225 }, RH = { 4.3641439688716, 0.989304812834225 } },
                     [5] = { 1, LH = { 4.6825486381323, 1 }, RH = { 5.333, 1 } },
                     [6] = { 1, LH = { 5.667, 1 } }
                  }
               },
               SplineColor = { Red = 0, Green = 204, Blue = 0 },
            },
            HueCurves2Blue = LUTBezier {
               SmoothEndsTransition = true,
               KeyColorSplines = {
                  [0] = {
                     [0] = { 1, RH = { 0.333, 1 } },
                     [1] = { 1, LH = { 0.667, 1 }, RH = { 1.36409727626459, 1 } },
                     [2.09338521400778] = { 1.87700534759358, LH = { 1.72928793774319, 1.87700534759358 }, RH = { 2.39528793774319, 1.87700534759358 } },
                     [3] = { 1, LH = { 2.69809727626459, 1 }, RH = { 3.3485486381323, 1 } },
                     [4.04669260700389] = { 0.989304812834225, LH = { 3.69814396887159, 0.989304812834225 }, RH = { 4.3641439688716, 0.989304812834225 } },
                     [5] = { 1, LH = { 4.6825486381323, 1 }, RH = { 5.333, 1 } },
                     [6] = { 1, LH = { 5.667, 1 } }
                  }
               },
               SplineColor = { Red = 54, Green = 54, Blue = 204 },
            },
            HueCurves2Lum = LUTBezier {
               SmoothEndsTransition = true,
               KeyColorSplines = {
                  [0] = {
                     [0] = { 1, RH = { 0.333, 1 } },
                     [1] = { 1, LH = { 0.667, 1 }, RH = { 1.333, 1 } },
                     [2] = { 1, LH = { 1.667, 1 }, RH = { 2.333, 1 } },
                     [3] = { 1, LH = { 2.667, 1 }, RH = { 3.333, 1 } },
                     [4] = { 1, LH = { 3.667, 1 }, RH = { 4.333, 1 } },
                     [5] = { 1, LH = { 4.667, 1 }, RH = { 5.333, 1 } },
                     [6] = { 1, LH = { 5.667, 1 } }
                  }
               },
               SplineColor = { Red = 204, Green = 204, Blue = 204 },
            },
            HueCurves1Blue = LUTBezier {
               SmoothEndsTransition = true,
               KeyColorSplines = {
                  [0] = {
                     [0] = { 1, RH = { 0.333, 1 } },
                     [1] = { 1, LH = { 0.667, 1 }, RH = { 1.333, 1 } },
                     [2] = { 1, LH = { 1.667, 1 }, RH = { 2.333, 1 } },
                     [3] = { 1, LH = { 2.667, 1 }, RH = { 3.333, 1 } },
                     [4] = { 1, LH = { 3.667, 1 }, RH = { 4.333, 1 } },
                     [5] = { 1, LH = { 4.667, 1 }, RH = { 5.333, 1 } },
                     [6] = { 1, LH = { 5.667, 1 } }
                  }
               },
               SplineColor = { Red = 134, Green = 134, Blue = 204 },
               CtrlWZoom = false,
            },
            HueCurves2Red = LUTBezier {
               SmoothEndsTransition = true,
               KeyColorSplines = {
                  [0] = {
                     [0] = { 1, RH = { 0.333, 1 } },
                     [1] = { 1, LH = { 0.667, 1 }, RH = { 1.36409727626459, 1 } },
                     [2.09338521400778] = { 1.87700534759358, LH = { 1.72928793774319, 1.87700534759358 }, RH = { 2.39528793774319, 1.87700534759358 } },
                     [3] = { 1, LH = { 2.69809727626459, 1 }, RH = { 3.3485486381323, 1 } },
                     [4.04669260700389] = { 0.989304812834225, LH = { 3.69814396887159, 0.989304812834225 }, RH = { 4.3641439688716, 0.989304812834225 } },
                     [5] = { 1, LH = { 4.6825486381323, 1 }, RH = { 5.333, 1 } },
                     [6] = { 1, LH = { 5.667, 1 } }
                  }
               },
               SplineColor = { Red = 204, Green = 42, Blue = 42 },
            },
            HueCurves2Hue = LUTBezier {
               SmoothEndsTransition = true,
               KeyColorSplines = {
                  [0] = {
                     [0] = { 1, RH = { 0.068863131049101, 1 } },
                     [0.2067] = { 1.50267379679144, LH = { 0.137769026762126, 1.50267379679144 }, RH = { 0.471097089812951, 1.50267379679144 }, Flags = { LockedX = true, Picked = true } },
                     [1] = { 1, LH = { 0.735863131049101, 1 }, RH = { 1.36409727626459, 1 } },
                     [2.09338521400778] = { 1.87700534759358, LH = { 1.72928793774319, 1.87700534759358 }, RH = { 2.37196498054475, 1.87700534759358 } },
                     [2.92996108949416] = { 1, LH = { 2.6513813229572, 1 }, RH = { 3.27850972762646, 1 } },
                     [3.97665369649805] = { 0.989304812834225, LH = { 3.65254146164211, 0.966915666160345 }, RH = { 4.31361866826322, 1.01258180569493 } },
                     [5] = { 1, LH = { 4.65922568093385, 1 }, RH = { 5.333, 1 } },
                     [6] = { 1, LH = { 5.667, 1 } }
                  }
               },
               SplineColor = { Red = 204, Green = 0, Blue = 204 },
            },
            HueCurves1Green = LUTBezier {
               SmoothEndsTransition = true,
               KeyColorSplines = {
                  [0] = {
                     [0] = { 1, RH = { 0.333, 1 } },
                     [1] = { 1, LH = { 0.667, 1 }, RH = { 1.333, 1 } },
                     [2] = { 1, LH = { 1.667, 1 }, RH = { 2.333, 1 } },
                     [3] = { 1, LH = { 2.667, 1 }, RH = { 3.333, 1 } },
                     [4] = { 1, LH = { 3.667, 1 }, RH = { 4.333, 1 } },
                     [5] = { 1, LH = { 4.667, 1 }, RH = { 5.333, 1 } },
                     [6] = { 1, LH = { 5.667, 1 } }
                  }
               },
               SplineColor = { Red = 102, Green = 204, Blue = 102 },
            }
         },
      },
      Ripples1 = ofx.com.blackmagicdesign.resolvefx.Ripple {
         Inputs = {
            Source = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            rippleShape = Input { Value = FuID { "RIPPLE_SHAPE_CIRCULAR" }, },
            waveShape = Input { Value = FuID { "WAVE_SHAPE_SINE" }, },
            shine = Input { Value = 1, },
            shineAzimuth = Input { Value = 21, },
            shineVertical = Input { Value = 49.57, },
            shineSize = Input { Value = 90, },
            shineStrength = Input { Value = 0.417, },
            animate = Input { Value = 1, },
            speed = Input {
               SourceOp = "Ripples1Speed",
               Source = "Value",
            },
            ripple1 = Input { Value = 1, },
            enable1 = Input { Value = 1, },
            Position1 = Input { Value = { 0.30078, 0.562936425209045 }, },
            amplitude1 = Input { Value = 0.9365, },
            frequency1 = Input { Value = 75.9, },
            decay1 = Input { Value = 5.9, },
            phase1 = Input { Value = 0.225, },
            xPosition1 = Input { Value = 0.5, },
            yPosition1 = Input { Value = 0.5, },
            ripple2 = Input { Value = 1, },
            enable2 = Input { Value = 1, },
            Position2 = Input { Value = { 0.772617608308792, 0.563236892223358 }, },
            amplitude2 = Input { Value = 0.5341, },
            frequency2 = Input { Value = 75, },
            decay2 = Input { Value = 10, },
            phase2 = Input { Value = 0, },
            xPosition2 = Input { Value = 0.5, },
            yPosition2 = Input { Value = 0.5, },
            ripple3 = Input { Value = 0, },
            enable3 = Input { Value = 0, },
            Position3 = Input { Value = { 0.5, 0.5 }, },
            amplitude3 = Input { Value = 0.449999988079071, },
            frequency3 = Input { Value = 75, },
            decay3 = Input { Value = 10, },
            phase3 = Input { Value = 0, },
            xPosition3 = Input { Value = 0.5, },
            yPosition3 = Input { Value = 0.5, },
            ripple4 = Input { Value = 0, },
            enable4 = Input { Value = 0, },
            Position4 = Input { Value = { 0.5, 0.5 }, },
            amplitude4 = Input { Value = 0.449999988079071, },
            frequency4 = Input { Value = 75, },
            decay4 = Input { Value = 10, },
            phase4 = Input { Value = 0, },
            xPosition4 = Input { Value = 0.5, },
            yPosition4 = Input { Value = 0.5, },
            ripple5 = Input { Value = 0, },
            enable5 = Input { Value = 0, },
            Position5 = Input { Value = { 0.5, 0.5 }, },
            amplitude5 = Input { Value = 0.449999988079071, },
            frequency5 = Input { Value = 75, },
            decay5 = Input { Value = 10, },
            phase5 = Input { Value = 0, },
            xPosition5 = Input { Value = 0.5, },
            yPosition5 = Input { Value = 0.5, },
            isLegacyScaleIndependence = Input { Value = 0, },
            blendGroup = Input { Value = 0, },
            blendIn = Input { Value = 1, },
            blend = Input { Value = 0, },
            ignoreContentShape = Input { Value = 0, },
            legacyIsProcessRGBOnly = Input { Value = 0, },
            refreshTrigger = Input { Value = 1, },
            resolvefxVersion = Input { Value = "1.4", },
         },
         ViewInfo = OperatorInfo { Pos = { 1045, 115.5 } },
      },
      Ripples1Speed = BezierSpline {
         SplineColor = { Red = 242, Green = 54, Blue = 41 },
         CtrlWZoom = false,
         KeyFrames = {
            [0] = { -1, RH = { 156.333333333333, 0.333333333333333 }, Flags = { Linear = true } },
            [469] = { 3, LH = { 312.666666666667, 1.66666666666667 }, Flags = { Linear = true } }
         }
      },
      Instance_Ripples1 = ofx.com.blackmagicdesign.resolvefx.Ripple {
         SourceOp = "Ripples1",
         Inputs = {
            SettingsNest = Input { },
            Source = Input { },
            shine = Input { Value = 0, },
            ripple1 = Input { Value = 1, },
            ripple2 = Input { Value = 1, },
            ripple3 = Input { Value = 0, },
            ripple4 = Input { Value = 0, },
            ripple5 = Input { Value = 0, },
            blendGroup = Input { Value = 0, },
            CommentsNest = Input { },
            FrameRenderScriptNest = Input { },
            StartRenderScripts = Input { },
            EndRenderScripts = Input { },
            EffectMask = Input { }
         },
         ViewInfo = OperatorInfo { Pos = { 880, 181.5 } },
      },
      Background1 = Background {
         Inputs = {
            GlobalOut = Input { Value = 469, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            UseFrameFormatSettings = Input { Value = 1, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftAlpha = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 880, 115.5 } },
      }
   }
}
Resolve Studio 17.4.3 and Fusion Studio 17.4.3 on macOS 11.6.1

Hackintosh:: X299, Intel i9-10980XE, 128GB DDR4, AMD 6900XT 16GB
Monitors: 1 x 3840x2160 & 3 x 1920x1200
Disk: 2TB NVMe + 4TB RAID0 NVMe; NAS: 36TB RAID6
BMD Speed Editor
Offline

George Woods

  • Posts: 36
  • Joined: Fri Aug 28, 2015 1:33 am

Re: How to use effect node to mask another effect node?

PostWed Nov 03, 2021 2:33 am

Good lord Tom! What an amazing reply - I was really expecting maybe a one sentence pointer, but you have gone over and above! I really appreciate it.

I also totally understood what you mean too.

This is almost exactly what I needed, I probably don't even need the two instances, as I think just having the effect using the shine component might be enough. But if it's not right, I've got the rest of the "big picture" from you here.

Thanks so much :)

Return to Fusion

Who is online

Users browsing this forum: Jeremy Lusk and 25 guests