Jump to: Board index » General » Fusion

Make real brush stroke rendering faster

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

Jinxer

  • Posts: 74
  • Joined: Thu Sep 23, 2021 3:06 pm
  • Real Name: Sergey Zinchenko

Make real brush stroke rendering faster

PostThu Sep 30, 2021 12:42 pm

Is there a way to make similar brush stroke faster? Maybe use Paint tool for this?

Image
Code: Select all
{
   Tools = ordered() {
      Merge4 = Merge {
         Inputs = {
            Background = Input {
               SourceOp = "Background2",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "UnsharpMask1",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 55, 82.5 } },
      },
      Background2 = Background {
         Inputs = {
            GlobalOut = Input { Value = 119, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            UseFrameFormatSettings = Input { Value = 1, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
         },
         ViewInfo = OperatorInfo { Pos = { -55, 82.5 } },
      },
      UnsharpMask1 = UnsharpMask {
         Inputs = {
            Input = Input {
               SourceOp = "Blur2",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { -55, 49.5 } },
      },
      Blur2 = Blur {
         CtrlWZoom = false,
         Inputs = {
            Filter = Input { Value = FuID { "Fast Gaussian" }, },
            XBlurSize = Input { Value = 1.2, },
            Input = Input {
               SourceOp = "Echo2",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { -165, 49.5 } },
      },
      Echo2 = Fuse.Echo {
         Inputs = {
            EchoFrames = Input { Value = 120, },
            SubFrames = Input { Value = 5, },
            Input = Input {
               SourceOp = "Merge3",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { -275, 49.5 } },
         Version = 110
      },
      Path = PolylineMask {
         DrawMode = "ModifyOnly",
         DrawMode2 = "InsertAndModify",
         NameSet = true,
         Inputs = {
            Filter = Input { Value = FuID { "Fast Gaussian" }, },
            MaskWidth = Input { Value = 1920, },
            MaskHeight = Input { Value = 1080, },
            PixelAspect = Input { Value = { 1, 1 }, },
            UseFrameFormatSettings = Input { Value = 1, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Polyline = Input {
               SourceOp = "Publish1",
               Source = "Value",
            },
            Polyline2 = Input {
               Value = Polyline {
               },
               Disabled = true,
            },
         },
         ViewInfo = OperatorInfo { Pos = { -220, -16.5 } },
      },
      Publish1 = PublishPolyLine {
         Inputs = {
            Value = Input {
               Value = Polyline {
                  Points = {
                     { Linear = true, X = -0.204166666666667, Y = -0.366666666666667, RX = 0.0648148148148156, RY = 0.209876543209875 },
                     { X = -0.00972222222222188, Y = 0.262962962962963, LX = -0.0510165601280974, LY = 0.18089577544107, RX = 0.0531039610895337, RY = -0.188297333182863 },
                     { X = 0.0833333333333334, Y = -0.346913580246914, LX = 0.0420854750724105, LY = -0.189519836462401, RX = -0.0401323735545192, RY = 0.180724605337437 },
                     { X = -0.193055555555556, Y = -0.0333333333333334, LX = 0.183541206727815, LY = -0.00384894533335716 }
                  }
               },
            },
         },
      },
      Merge3 = Merge {
         EnabledRegion = TimeRegion { { Start = 0, End = 299.9999, FrameLength = 1 } },
         Inputs = {
            Background = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "FastNoise3",
               Source = "Output",
            },
            Center = Input {
               SourceOp = "Path2",
               Source = "Position",
            },
            Size = Input {
               SourceOp = "Merge3Size",
               Source = "Value",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { -385, 49.5 } },
      },
      Path2 = PolyPath {
         DrawMode = "InsertAndModify",
         Inputs = {
            Displacement = Input {
               SourceOp = "Path2Displacement",
               Source = "Value",
            },
            PolyLine = Input {
               SourceOp = "Publish1",
               Source = "Value",
            },
         },
      },
      Path2Displacement = BezierSpline {
         SplineColor = { Red = 255, Green = 0, Blue = 255 },
         KeyFrames = {
            [0] = { 0, RH = { 39.6666666666667, 0.333333333333333 }, Flags = { LockedY = true } },
            [119] = { 1, LH = { 79.3333333333333, 0.666666666666667 }, Flags = { Linear = true } }
         }
      },
      Merge3Size = BezierSpline {
         SplineColor = { Red = 225, Green = 0, Blue = 157 },
         KeyFrames = {
            [0] = { 0.8, RH = { 1.66666666666667, 0.866666666666667 }, Flags = { Linear = true } },
            [5] = { 1, LH = { 1.4, 1 }, RH = { 33.3321009038174, 0.94872017935935 } },
            [90] = { 0.8, LH = { 61.6666666666667, 0.8 }, RH = { 99, 0.8 } },
            [117] = { 0.5, LH = { 108, 0.5 }, RH = { 118.55, 0.5 } },
            [119] = { 0.25, LH = { 118.333333333333, 0.333333333333333 } }
         }
      },
      Displace2 = Displace {
         Inputs = {
            RefractionStrength = Input { Value = 0.57, },
            Input = Input {
               SourceOp = "Ellipse2",
               Source = "Mask",
            },
            Foreground = Input {
               SourceOp = "Instance_FastNoise3",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { -385, -16.5 } },
      },
      FastNoise3 = FastNoise {
         Inputs = {
            EffectMask = Input {
               SourceOp = "Displace2",
               Source = "Output",
            },
            GlobalOut = Input { Value = 119, },
            Width = Input {
               Value = 100,
               Expression = "Ellipse2.MaskWidth",
            },
            Height = Input {
               Value = 100,
               Expression = "Width",
            },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Brightness = Input { Value = -0.85, },
            XScale = Input { Value = 4.25, },
            SeetheRate = Input { Value = 0.08, },
         },
         ViewInfo = OperatorInfo { Pos = { -385, 16.5 } },
      },
      Ellipse2 = EllipseMask {
         Inputs = {
            Filter = Input { Value = FuID { "Fast Gaussian" }, },
            OutputSize = Input { Value = FuID { "Custom" }, },
            MaskWidth = Input { Value = 100, },
            MaskHeight = Input {
               Value = 100,
               Expression = "MaskWidth",
            },
            PixelAspect = Input { Value = { 1, 1 }, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Width = Input { Value = 0.4, },
            Height = Input {
               Value = 0.6472,
               Expression = "Width*1.618",
            },
         },
         ViewInfo = OperatorInfo { Pos = { -385, -49.5 } },
      },
      Instance_FastNoise3 = FastNoise {
         SourceOp = "FastNoise3",
         Inputs = {
            EffectMask = Input { },
            SettingsNest = Input { },
            ImageNest = Input { },
            Width = Input {
               Value = 100,
               Expression = "Ellipse2.MaskWidth"
            },
            Height = Input {
               Value = 100,
               Expression = "Width"
            },
            ["Gamut.ColorSpaceNest"] = Input { Value = 1, },
            ["Gamut.GammaSpaceNest"] = Input { },
            NoiseNest = Input { },
            Contrast = Input { Value = 2, },
            Brightness = Input { },
            Color1Nest = Input { },
            Color2Nest = Input { },
            GradientNest = Input { },
            NoiseBrightnessMap = Input { },
            NoiseDetailMap = Input { },
            CommentsNest = Input { },
            FrameRenderScriptNest = Input { },
            StartRenderScripts = Input { },
            EndRenderScripts = Input { },
         },
         ViewInfo = OperatorInfo { Pos = { -495, -16.5 } },
      },
      Background1 = Background {
         Inputs = {
            GlobalOut = Input { Value = 119, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftAlpha = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { -495, 49.5 } },
      }
   },
   ActiveTool = "Blur2"
}
Offline
User avatar

Chad Capeland

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

Re: Make real brush stroke rendering faster

PostFri Oct 01, 2021 7:34 pm

Duplicate is a bit faster than Echo in this case, but not by much. If you set FastNoise3 to no update, it gets a lot faster.
Chad Capeland
Indicated, LLC
www.floweffects.com
Offline

Jinxer

  • Posts: 74
  • Joined: Thu Sep 23, 2021 3:06 pm
  • Real Name: Sergey Zinchenko

Re: Make real brush stroke rendering faster

PostFri Oct 01, 2021 8:46 pm

Thanks for your help. The idea is to get a constantly changing brush pattern.
The best I've got so far is a Paint node. It is extremely fast compare to Echo. There is only one problem with this approach: all the drawn noise samples are constantly changing. Do you know how to fix drawn samples and keep only the last noise sample changing?
Image
Code: Select all
{
   Tools = ordered() {
      Instance_FastNoise3_1 = FastNoise {
         SourceOp = "FastNoise3_1",
         Inputs = {
            EffectMask = Input { },
            SettingsNest = Input { },
            ImageNest = Input { },
            Width = Input {
               Value = 100,
               Expression = "Ellipse2_1.MaskWidth"
            },
            Height = Input {
               Value = 100,
               Expression = "Width"
            },
            ["Gamut.ColorSpaceNest"] = Input { Value = 1, },
            ["Gamut.GammaSpaceNest"] = Input { },
            NoiseNest = Input { },
            Contrast = Input { Value = 2, },
            Brightness = Input { },
            Color1Nest = Input { },
            Color2Nest = Input { },
            GradientNest = Input { },
            NoiseBrightnessMap = Input { },
            NoiseDetailMap = Input { },
            CommentsNest = Input { },
            FrameRenderScriptNest = Input { },
            StartRenderScripts = Input { },
            EndRenderScripts = Input { },
         },
         ViewInfo = OperatorInfo { Pos = { -495, 148.5 } },
      },
      Displace2_1 = Displace {
         Inputs = {
            RefractionStrength = Input { Value = 0.57, },
            Input = Input {
               SourceOp = "Ellipse2_1",
               Source = "Mask",
            },
            Foreground = Input {
               SourceOp = "Instance_FastNoise3_1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { -385, 148.5 } },
      },
      Ellipse2_1 = EllipseMask {
         Inputs = {
            Filter = Input { Value = FuID { "Fast Gaussian" }, },
            OutputSize = Input { Value = FuID { "Custom" }, },
            MaskWidth = Input { Value = 100, },
            MaskHeight = Input {
               Value = 100,
               Expression = "MaskWidth",
            },
            PixelAspect = Input { Value = { 1, 1 }, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Width = Input { Value = 0.4, },
            Height = Input {
               Value = 0.6472,
               Expression = "Width*1.618",
            },
         },
         ViewInfo = OperatorInfo { Pos = { -385, 115.5 } },
      },
      FastNoise3_1 = FastNoise {
         Inputs = {
            EffectMask = Input {
               SourceOp = "Displace2_1",
               Source = "Output",
            },
            GlobalOut = Input { Value = 119, },
            Width = Input {
               Value = 100,
               Expression = "Ellipse2_1.MaskWidth",
            },
            Height = Input {
               Value = 100,
               Expression = "Width",
            },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Brightness = Input { Value = -0.85, },
            XScale = Input { Value = 4.25, },
            SeetheRate = Input { Value = 0.08, },
         },
         ViewInfo = OperatorInfo { Pos = { -385, 181.5 } },
      },
      Paint1 = Paint {
         CtrlWZoom = false,
         Inputs = {
            Input = Input {
               SourceOp = "Background3",
               Source = "Output",
            },
            Paint = Input {
               SourceOp = "PolylineStroke1",
               Source = "Out",
            },
         },
         ViewInfo = OperatorInfo { Pos = { -385, 247.5 } },
      },
      PolylineStroke1 = PolylineStroke {
         Points = {
         },
         IsThreaded = false,
         Brushes = {
            "SoftBrush",
            "ImageBrush"
         },
         ApplyModes = {
            "PaintApplyColor",
            "PaintApplyRubThrough",
            "PaintApplyEmboss",
            "PaintApplyErase",
            "PaintApplyMerge",
            "PaintApplySmear",
            "PaintApplyStamp",
            "WireApply"
         },
         CtrlWZoom = false,
         Inputs = {
            BrushControls = Input { Value = 1, },
            BrushShape = Input { Value = FuID { "ImageBrush" }, },
            StrokeControls = Input { Value = 1, },
            WriteOnStart = Input {
               SourceOp = "PolylineStroke1Start1",
               Source = "Value",
            },
            WriteOnEnd = Input {
               SourceOp = "PolylineStroke1End1",
               Source = "Value",
            },
            Spacing = Input { Value = 0.055, },
            Polyline = Input {
               Value = Polyline {
                  Points = {
                     { Linear = true, X = -0.233333333333333, Y = -0.32962962962963, RX = 0.0861111111111111, RY = 0.190946502057613 },
                     { X = 0.025, Y = 0.24320987654321, LX = -0.0458333333333336, LY = 0.204938271604938, RX = 0.0379587481267486, RY = -0.169728005091994 },
                     { X = 0.136111111111111, Y = -0.267901234567901, LX = 0.123611111111108, LY = -0.271604938271609, RX = -0.0748931130463261, RY = 0.164559149764712 },
                     { X = -0.186111111111111, Y = 0.00617283950617287, LX = 0.173611111111111, LY = -0.00246913580247051 }
                  }
               },
            },
            ["ImageBrush.Size"] = Input { Value = 0.03, },
            ["ImageBrush.ImageSource"] = Input { Value = 0, },
            ["ImageBrush.SourceTool"] = Input {
               SourceOp = "FastNoise3_1",
               Source = "Output",
            },
            ["ImageBrush.Brush"] = Input { UserString1 = "ball_metal", },
         },
      },
      PolylineStroke1Start1 = BezierSpline {
         SplineColor = { Red = 232, Green = 6, Blue = 244 },
         NameSet = true,
         KeyFrames = {
            [0] = { 0, RH = { 2.33333333333333, 0 }, Flags = { Linear = true } },
            [7] = { 0, LH = { 4.66666666666667, 0 }, RH = { 29, 0 }, Flags = { Linear = true } },
            [73] = { 0, LH = { 51, 0 }, RH = { 88.3333333333333, 0 }, Flags = { Linear = true } },
            [119] = { 0, LH = { 103.666666666667, 0 }, Flags = { Linear = true } }
         }
      },
      PolylineStroke1End1 = BezierSpline {
         SplineColor = { Red = 72, Green = 233, Blue = 54 },
         NameSet = true,
         KeyFrames = {
            [0] = { 0, RH = { 2.33333333333333, 0.0196078333333333 }, Flags = { Linear = true } },
            [7] = { 0.0588235, LH = { 4.66666666666667, 0.0392156666666667 }, RH = { 29, 0.243697466666667 }, Flags = { Linear = true } },
            [73] = { 0.6134454, LH = { 51, 0.428571433333333 }, RH = { 88.3333333333333, 0.742296933333333 }, Flags = { Linear = true } },
            [119] = { 1, LH = { 103.666666666667, 0.871148466666667 }, Flags = { Linear = true } }
         }
      },
      Background3 = Background {
         Inputs = {
            GlobalOut = Input { Value = 119, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            UseFrameFormatSettings = Input { Value = 1, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
         },
         ViewInfo = OperatorInfo { Pos = { -495, 247.5 } },
      }
   },
   ActiveTool = "Paint1"
}
Offline
User avatar

TheBloke

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

Re: Make real brush stroke rendering faster

PostSat Oct 02, 2021 6:20 am

I experimented with this the other day when you first posted and couldn't find a way to get the Paint node to stop updating. It seems like it is something that should be possible, as although it can be useful to have a Paint node that keeps updating the stroke when the input Tool updates, it would also be great to have the Paint node commit the current state of the Tool on each frame and not update it after that point.

I couldn't find a workaround but maybe someone knows a trick.
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

Jinxer

  • Posts: 74
  • Joined: Thu Sep 23, 2021 3:06 pm
  • Real Name: Sergey Zinchenko

Re: Make real brush stroke rendering faster

PostSat Oct 02, 2021 1:08 pm

What does a Paint node consist of? I suppose there is a some kind of stamping. Can we recreate that with other nodes?
Offline

Jinxer

  • Posts: 74
  • Joined: Thu Sep 23, 2021 3:06 pm
  • Real Name: Sergey Zinchenko

Re: Make real brush stroke rendering faster

PostTue Oct 05, 2021 11:58 am

Keyframes don't work in Paint either. I can't set the size of the brush for different parts of the stroke. What do Blackmagic representatives think about this?
Offline
User avatar

Chad Capeland

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

Re: Make real brush stroke rendering faster

PostTue Oct 05, 2021 5:11 pm

You can hack the brush size by using the tablet settings.

It would be nice if there was a LUT curve control for the brush size so it would be easier to edit.
Chad Capeland
Indicated, LLC
www.floweffects.com
Offline

Jinxer

  • Posts: 74
  • Joined: Thu Sep 23, 2021 3:06 pm
  • Real Name: Sergey Zinchenko

Re: Make real brush stroke rendering faster

PostWed Oct 06, 2021 1:23 pm

Chad Capeland wrote:You can hack the brush size by using the tablet settings.

Can you show an example of that? I tried tablet's Pressure setting but it does not work. I don't see any difference compare to Constant.
Offline

Jinxer

  • Posts: 74
  • Joined: Thu Sep 23, 2021 3:06 pm
  • Real Name: Sergey Zinchenko

Re: Make real brush stroke rendering faster

PostFri Oct 08, 2021 9:30 am

Does anybody know how to change brush size by using the tablet settings?

Return to Fusion

Who is online

Users browsing this forum: No registered users and 25 guests