Jump to: Board index » General » Fusion

very high res flow pipeline - toggle res advice

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

Roei T

  • Posts: 17
  • Joined: Mon Apr 26, 2021 7:24 pm
  • Location: Tel Aviv
  • Real Name: Roei Tzoref

very high res flow pipeline - toggle res advice

PostWed Oct 20, 2021 9:29 pm

Hi, need advice on working with high res flow and be able to switch to low res back and forth.

I am doing 360/VR work with sources ranging from 8K*8K(CG Backgrounds), 5.7K*5.7K that needs to be resized to 8K to match (Live Action) and HD that need to stay HD (inserts).

the delivery is supposed to be 4K (UHD), and eventually 8K for future proofing.

so far, I have worked 8K all the way, and at the end used a resize node to 4K before the saver node. eventually disabling the resize when I needed 8K. as you imagine, rendering a frame can take a while. for a full flow that could be 7 minutes.

I tried using low res proxies alternates in the loaders, that would help a little. of course using the proxy switch all the way to 10 sometime. I need more than that.

now trying to have the resize be after the loaders instead of before the saver, so I can work 4k all the way. I am trying the workflow of managing the format default preference in the preferences bcause that helps to some bg nodes along the way that since they are creator nodes, they feed from the frame default in the preference (if the checkbox is checked). same as the resize node.

so I got this as the loader start of my tree
https://imgur.com/a/5lvqYC0

here I am using a resize master node with instance to every loader to set it at 8K or 4K based on the frame default in the preferences. so I can create a preset in the preferences of 8K and 4K and switch each time I want to toggle between res and in addition to changing all my resize nodes, the bg nodes will change as well.

for the HD loaders to downgraded by half I use a resize node with expression to set it to 0.5 when I change to 4k.

so far trouble I see that when I change the preset in the preference, I have to toggle "use frame format settings checkbox" in the resize node to make it refresh to the new preset, this is why I have instances. bg nodes in contrast are changing immediately with no intervention, and I got another resize node for my hd sources to 0.5 scale factor. this way I can toggle between 4k and 8k.

how does it look so far? does anyone have advice for this type of workflow for making it better or more efficient? my purpose is to work 4K most of the time, with the intention of finally delivering 4k and 8K, and be able to switch between the two if needed for checking along the way, including the bg tools. all of this for better render times as I work.

Thanks
Offline
User avatar

Bryan Ray

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

Re: very high res flow pipeline - toggle res advice

PostThu Oct 21, 2021 3:29 am

Seems like a pretty solid plan to me. There are a small number of tools that are not resolution independent and could potentially trip you up. If you use the Filter tool for edge detection, it operates on absolute pixel neighborhoods, so you might need to adjust those when upscaling to your final output. And Optical Flow encodes vectors in pixel values, so when upscaling you'll need to either recalculate the vectors or scale them. Gain is the same as Scale for vectors, so you just need to calculate the multiplier that gets you from the calculated size to the target size. It's a linear relationship, though, so all you need to do is divide your target size by your original size, and that will give you the value to put in the Gain control. Do this in float32, obviously.

There are probably some other tools that might present issues, but I don't recall them off the top of my head. FilmGrain, I think, might be another one you'd need to retune for the new size.
Bryan Ray
http://www.bryanray.name
http://www.musevfx.com
Offline
User avatar

Roei T

  • Posts: 17
  • Joined: Mon Apr 26, 2021 7:24 pm
  • Location: Tel Aviv
  • Real Name: Roei Tzoref

Re: very high res flow pipeline - toggle res advice

PostThu Oct 21, 2021 8:35 am

thanks @brianray, will keep exploring this.
Offline
User avatar

Roei T

  • Posts: 17
  • Joined: Mon Apr 26, 2021 7:24 pm
  • Location: Tel Aviv
  • Real Name: Roei Tzoref

Re: very high res flow pipeline - toggle res advice

PostThu Oct 21, 2021 3:34 pm

eventually the frame default was to messy to work with because I had different inputs and I needed a scale factor. so with the help of @thebloke I put this expression
Code: Select all
Resize_(name).Input.Width * Scale
on width and height and added a scale control multiplier.
an this scale multiplier is connecter to a master scale node. like this
https://imgur.com/a/oKJ3DSP

and since I am not using frame default method, I had to put this node also after bg nodes. once this was set the last thing was to see if there are effects that are resolution dependent and surely frishluft DOF was that. so I had to have another controller just for that.

eventually the master controller looked like this:
https://imgur.com/a/9QYkJ0Q

DOF value for 8K was 10 radius. so connecting it to the scale with a little math means I can just change the scale. now my flow is much faster. hopefully this method will prove efficient when I try it on different setups.
Offline
User avatar

Bryan Ray

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

Re: very high res flow pipeline - toggle res advice

PostThu Oct 21, 2021 4:06 pm

Since you're bypassing the Frame Format control, be careful with any mask tools. If they (or a chain of them) are plugged directly into an EffectMask input, they should adapt resolution automatically, but we've found that if you do a distributed render, they won't always calculate their own size at the right time, and they might flicker between the Frame Format and their derived size. I think this might be related to the Simultaneous Branching preference, but I've never tested that theory.

edit: Oh, and you should use OriginalWidth and OriginalHeight in your expressions instead of just Width and Height. Otherwise Proxy mode won't work correctly.
Bryan Ray
http://www.bryanray.name
http://www.musevfx.com
Offline
User avatar

Roei T

  • Posts: 17
  • Joined: Mon Apr 26, 2021 7:24 pm
  • Location: Tel Aviv
  • Real Name: Roei Tzoref

Re: very high res flow pipeline - toggle res advice

PostThu Oct 21, 2021 4:30 pm

Thank you! just found this resource when expression didn't work
https://www.steakunderwater.com/VFXPedi ... xpressions

so can I just tell the node to get the data from the node name without entering it specifically? I know I can later copy paste and it will be relative, but in Ae you can use "This.Layer" instead of "resize_1_1_1"

I am using a render farm to render frames. in what exact scenario I should be aware of mask not rendering correctly? would you recommend using the frame default way anyway? it's just a thing where I got some sources that I don't want to be using frame default. and getting to that preference is longer than just toggling a control slider. but if it's better I would get used to that. nobody want's a bad render. the simultaneous branching in the preferences is not checked
Last edited by Roei T on Thu Oct 21, 2021 4:37 pm, edited 1 time in total.
Offline
User avatar

TheBloke

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

Re: very high res flow pipeline - toggle res advice

PostThu Oct 21, 2021 4:56 pm

Roei T wrote:so can I just tell the node to get the data from the node name without entering it specifically? I know I can later copy paste and it will be relative, but in Ae you can use "This.Layer" instead of "resize_1_1_1"
In the case of controls, leave out the node name, eg "Scale" instead of "Resize1.Scale"

However that doesn't work for everything. You can see in the expression I gave you that it was:
Code: Select all
Resize1.Input.Width * Scale
Scale, a custom control on this node, does not have the node name in there. Resize1.Input.Width, which is not a control but a property on the input to this node, does need the node name.

I'm not 100% sure on the syntax and scope rules here, but I think this is because as a convenience expressions can refer to controls on the current node without a node name, but this only applies to controls, and Resize1.Input.Width is something different.

Unfortunately BMD have not updated the scripting documentation for Fusion since Fusion 8 - five years ago. But the documentation released then still mostly applies. You can find it here.

Regarding frame format: one concern I have is that you suggest you're going to be doing:

Background -> Resize

and not adjusting Frame Format. Does this mean you will leave the Frame Format at 8K?

If so, I wonder if this is going to improve performance as much as you hope. Because those Background (and any other generator nodes, like Text+, Renderer3D, etc) are still going to be creating 8K images, then you're going to resize them down to 4K.

It seems to me that that must be slower than just generating the image at 4K in the first place? It's not as optimal as just generating at 4K in the first place, and only using Resize for 8K footage.

If you change Frame Format, then in the 4K case you will only generate 4K of pixels, and you won't need a Resize node afterwards. So that's one operation instead of two, and only creating 4K pixels instead of creating 8K pixels.

How much this will matter will depend on how many generator nodes you have and what you're doing with them. It might be worth benchmarking both methods?
Resolve Studio 17.4.2 and Fusion Studio 17.4.2 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
User avatar

Roei T

  • Posts: 17
  • Joined: Mon Apr 26, 2021 7:24 pm
  • Location: Tel Aviv
  • Real Name: Roei Tzoref

Re: very high res flow pipeline - toggle res advice

PostThu Oct 21, 2021 6:31 pm

thanks @thebloke

regarding the node name, what I meant was the syntax is this:
Code: Select all
Resize1_2_2_1_1.Input.OriginalWidth * Scale
because it seem to need the node name in there. I thought maybe something like "this.node" kind of thing is out there. instead of me entering the exact node name. although as I said once I do one of them, it's relative and I can copy paste.

notice the "original" had to be there for proxies to work.

Roei T wrote:and not adjusting Frame Format. Does this mean you will leave the Frame Format at 8K?


yes. I do see a big increase in speed still. in this specific comp only one bg node. but will test this further.

the reason I am seeing the frame format workflow is less ideal is because:
1. even if there is a check box on the resize nodes for "use frame format", it doesn't update unless I toggle it on and off after I select the preset in the preferences. this means I need to rig all the resize preset to a master preset so I can check it on/off to update

2. I have variety of sources, not all are 8k. some are 5.7k, some are HD, so I need a relative scale as well. so if I use frame format to change res, I will have to also manually change other resize nodes or at least rig them all together to a control node.

3. getting to the preferences, frame format, choosing a preset, closing the menu - is much longer than just changing 0.5 to 1 in a controller.

I will examine benchmarks but so far it's much faster with this rig. BTW the bg nodes I am using are blank bg nodes that I need for different purposes of planting inserts in some places over the 8k cg's. the cons of the manual resize node method is I have to rememeber adding a resize node after every bg node.

TheBloke wrote:It might be worth benchmarking both methods?

ok I did for 1 frame
8K - 50.54s
4k manual resize - 17.97s
4k - setting the bg node (had one) to 4k, instead of a resize node after - 17.84s

here's a recording of the difference between 4k and 8k with the manual rigged resize node method: https://drive.google.com/file/d/194_xiO ... p=drivesdk
Offline
User avatar

Roei T

  • Posts: 17
  • Joined: Mon Apr 26, 2021 7:24 pm
  • Location: Tel Aviv
  • Real Name: Roei Tzoref

Re: very high res flow pipeline - toggle res advice

PostThu Oct 21, 2021 7:40 pm

I do get this strange behavior sometimes where my flow is getting stuck in some calculation. not sure why this happens. last time it happened it was because the rigged resize nodes where also checked for "frame default" but now they aren't. check this out:

https://drive.google.com/file/d/1Igeqcq ... p=drivesdk
Offline
User avatar

Bryan Ray

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

Re: very high res flow pipeline - toggle res advice

PostThu Oct 21, 2021 7:52 pm

You can reference the node the expression lives on with self:

Code: Select all
{
   Tools = ordered() {
      Background1 = Background {
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 275, -16.5 } },
      },
      Resize1 = BetterResize {
         Inputs = {
            Width = Input {
               Value = 480,
               Expression = "self.Input.OriginalWidth * 0.25",
            },
            Height = Input {
               Value = 270,
               Expression = "self.Input.OriginalHeight * 0.25",
            },
            HiQOnly = Input { Value = 0, },
            PixelAspect = Input { Value = { 1, 1 }, },
            Input = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 385, -16.5 } },
      }
   }
}



Roei T wrote: in what exact scenario I should be aware of mask not rendering correctly? would you recommend using the frame default way anyway? it's just a thing where I got some sources that I don't want to be using frame default. and getting to that preference is longer than just toggling a control slider. but if it's better I would get used to that. nobody want's a bad render. the simultaneous branching in the preferences is not checked


I wish I could answer that question definitively, but as I said, I haven't done any kind of rigorous testing. I just know that there are occasions when our roto would appear to be flickering, and checking the Frame Format setting usually revealed that it didn't match the comp's actual output—the masks were arbitrarily choosing either the derived size from the tool they were plugged into or the Frame Format size. My educated guess is because they sometimes get the request before the tool that called on them established its own size.

A node doesn't know its own output resolution until its processed a request for the first time. I have a couple of scripts where I have to force an image into a Viewer prior to setting a variable because TOOLI_ImageHeight and TOOLI_ImageWidth are nil until that's happened.
Bryan Ray
http://www.bryanray.name
http://www.musevfx.com
Offline
User avatar

Roei T

  • Posts: 17
  • Joined: Mon Apr 26, 2021 7:24 pm
  • Location: Tel Aviv
  • Real Name: Roei Tzoref

Re: very high res flow pipeline - toggle res advice

PostThu Oct 21, 2021 8:10 pm

Bryan Ray wrote:You can reference the node the expression lives on with self:

Great! self! easy!

as for the other thing - guess I will have to see for myself. if I have trouble, I will fall back on frame default. I may integrate both methods - use the frame default for the bg nodes, and the loaders with resize node unchecked.
Offline
User avatar

TheBloke

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

Re: very high res flow pipeline - toggle res advice

PostThu Oct 21, 2021 8:29 pm

Roei T wrote:ok I did for 1 frame
8K - 50.54s
4k manual resize - 17.97s
4k - setting the bg node (had one) to 4k, instead of a resize node after - 17.84s
OK fair enough. I might have benchmarked more frames to be sure, but based on your initial results it looks like there's little improvement, so use the easier method for sure.

Roei T wrote:the cons of the manual resize node method is I have to rememeber adding a resize node after every bg node.
You could make a little macro for this. Then you'd just add the macro each time. You might call it "BGResize" or something like that, then it can be added like any other node.
Resolve Studio 17.4.2 and Fusion Studio 17.4.2 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
User avatar

Roei T

  • Posts: 17
  • Joined: Mon Apr 26, 2021 7:24 pm
  • Location: Tel Aviv
  • Real Name: Roei Tzoref

Re: very high res flow pipeline - toggle res advice

PostThu Oct 21, 2021 8:47 pm

Roei T wrote:you'd just add the macro each time. You might call it "BGResize" or something like that, then it can be added like any other node.


interesting idea! thanks.
Offline
User avatar

Bryan Ray

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

Re: very high res flow pipeline - toggle res advice

PostThu Oct 21, 2021 11:17 pm

I meant to mention earlier: You could probably make a little script for changing the Frame Format, too. I'd probably put it on a button on a tool, like this:

Code: Select all
{
   Tools = ordered() {
      BrightnessContrast1 = BrightnessContrast {
         CtrlWZoom = false,
         ViewInfo = OperatorInfo { Pos = { 0, 82.5 } },
         UserControls = ordered() {
            UHD = {
               LINKS_Name = "UHD",
               LINKID_DataType = "Number",
               INPID_InputControl = "ButtonControl",
               INP_Integer = false,
               BTNCS_Execute = [[
                  composition:SetPrefs({["Comp.FrameFormat.Width"]=3840, ["Comp.FrameFormat.Height"]=2160 })
               ]],
               ICS_ControlPage = "Controls",
            },
            HD = {
               LINKS_Name = "HD",
               LINKID_DataType = "Number",
               INPID_InputControl = "ButtonControl",
               INP_Integer = false,
               BTNCS_Execute = [[
                  composition:SetPrefs({["Comp.FrameFormat.Width"]=1920, ["Comp.FrameFormat.Height"]=1080 })
               ]],
               ICS_ControlPage = "Controls",
            }
         }
      }
   },
   ActiveTool = "BrightnessContrast1"
}
Bryan Ray
http://www.bryanray.name
http://www.musevfx.com
Offline
User avatar

Roei T

  • Posts: 17
  • Joined: Mon Apr 26, 2021 7:24 pm
  • Location: Tel Aviv
  • Real Name: Roei Tzoref

Re: very high res flow pipeline - toggle res advice

PostFri Oct 22, 2021 6:57 am

oh this is wonderful :) I can change the numbers here to make it customizable to my needs. can you figure out why the resize nodes not play along with the changing of the frame format? it seems I have to toggle it on and off to make it change to the new format settings.

and about that constant render of the flow? any ideas why it does that? I removed some checkboxes from the resize nodes (keep aspect ratio) it seems it's stuck in a loop of calculations sometimes.
Offline
User avatar

Bryan Ray

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

Re: very high res flow pipeline - toggle res advice

PostSat Oct 23, 2021 12:12 am

Roei T wrote:oh this is wonderful :) I can change the numbers here to make it customizable to my needs. can you figure out why the resize nodes not play along with the changing of the frame format? it seems I have to toggle it on and off to make it change to the new format settings.


I'm not sure. I suspect it might have something to do with some of the flags on that particular input. A quick comparison to another CheckboxControl elsewhere shows that the flags INPB_External and INPB_InitialNotify are both false for the UseFrameFormat control but true for the other. I don't know what those two flags mean, but either or both could be responsible for that behavior. Alas, I couldn't manage to change either one with SetAttrs(), so I couldn't test the hypothesis.

and about that constant render of the flow? any ideas why it does that? I removed some checkboxes from the resize nodes (keep aspect ratio) it seems it's stuck in a loop of calculations sometimes.


Impossible to diagnose without being able to actually dig into the comp and test things. Most of the time when I see that, it's turned out to be either a caching problem or an indirect circular reference. There are a very small number of circumstances where you can create a circular reference, though—Fusion's quite good at preventing them—so that's not usually it. I noticed there's a TimeStretcher up near the start of the Flow—sometimes trying to grab information from more than one frame at the same time seems to cause the cache to be continuously invalidated.
Bryan Ray
http://www.bryanray.name
http://www.musevfx.com
Offline
User avatar

Roei T

  • Posts: 17
  • Joined: Mon Apr 26, 2021 7:24 pm
  • Location: Tel Aviv
  • Real Name: Roei Tzoref

Re: very high res flow pipeline - toggle res advice

PostSat Oct 23, 2021 10:12 am

thanks for the help so far, I need to dig into your website and exhausts the expression guidance (and other resources mentioned). coming from after effects, it seems the language is a bit similar, but not really.

eventually after getting additional help in the POC discord channel, with help of @millolab (how do you properly tag users here?) I made this setup:
https://imgur.com/a/NZERx4T

so it works this way:
    1. you choose 8K or 4K (these are my needs, I was able to understand what to change in the text editor). now all creator nodes are in frame format pushed.

    2. you check off and on the checkbox "use frame format" - to make sure the change took effect.

    3. you change the scale factor to affect all loaders to be half the size (it was Emilio's Idea to put scale instead of resize - so no need for all the code in original.height/width etc). using lanczos filter for the downscale... not sure it's the best for my needs. I got a mix of CG, VIDEO which is photoreal, solid graphics (luma mattes) which seem to be better on nearest neighbor.

    4. it has an if statement on the filter method to choose nearest neighbor filtering when it remains 8K to not add manipulation if it remains 8K.

    5. resolution dependent effects like frishluft DOF get special treatment and linked via expression to the scale factor

what I would change if I new how (and I tried) is a combo controller instead of a button. because you can only chose one res each time. then I would like the scale factor to that combo. this way I only have to chose one thing.

about the looping flow - I think I got this sorted after I removed some checkboxs in the resize nodes.

what do you think? in the end this could be a neat template for others to use.

this is the master resize node:
Code: Select all
{
   Tools = ordered() {
      ResizeMaster = BetterResize {
         CtrlWZoom = false,
         NameSet = true,
         Inputs = {
            UseFrameFormatSettings = Input { Value = 1, },
            Width = Input { Value = 4096, },
            Height = Input { Value = 4096, },
            HiQOnly = Input { Value = 0, },
            PixelAspect = Input { Value = { 1, 1 }, },
            FilterMethod = Input {
               Value = 8,
               Expression = "iif(ScaleFactor==0.5,8,0)",
            },
            ScaleFactor = Input { Value = 0.5, }
         },
         ViewInfo = OperatorInfo { Pos = { 1760, -49.5 } },
         Colors = { TileColor = { R = 0.666666666666667, G = 0, B = 0.498039215686275 }, },
         UserControls = ordered() {
            A = {
               INP_Integer = false,
               LINKID_DataType = "Number",
               BTNCS_Execute = "                  composition:SetPrefs({[\"Comp.FrameFormat.Width\"]=8192, [\"Comp.FrameFormat.Height\"]=8192 })\n               ",
               ICS_ControlPage = "Controls",
               INPID_InputControl = "ButtonControl",
               LINKS_Name = "8K"
            },
            B = {
               INP_Integer = false,
               LINKID_DataType = "Number",
               BTNCS_Execute = "                  composition:SetPrefs({[\"Comp.FrameFormat.Width\"]=4096, [\"Comp.FrameFormat.Height\"]=4096 })\n               ",
               ICS_ControlPage = "Controls",
               INPID_InputControl = "ButtonControl",
               LINKS_Name = "4K"
            },
            ScaleFactor = {
               INP_MaxAllowed = 1,
               INP_Integer = false,
               INPID_InputControl = "SliderControl",
               INP_MaxScale = 1,
               INP_MinScale = 0,
               INP_MinAllowed = 0,
               LINKID_DataType = "Number",
               ICS_ControlPage = "Controls",
               LINKS_Name = "Scale Factor"
            }
         }
      }
   },
   ActiveTool = "ResizeMaster"
}


this is the scale resize node:
Code: Select all
{
   Tools = ordered() {
      Scale1 = Scale {
         CtrlWZoom = false,
         Inputs = {
            XSize = Input {
               Value = 0.5,
               Expression = "ResizeMaster.ScaleFactor",
            },
            HiQOnly = Input { Value = 0, },
            PixelAspect = Input { Value = { 1, 1 }, },
            FilterMethod = Input {
               Value = 8,
               Expression = "ResizeMaster.FilterMethod",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 2200, 247.5 } },
         Colors = { TileColor = { R = 0.666666666666667, G = 0, B = 0.498039215686275 }, }
      }
   },
   ActiveTool = "Scale1"
}
Offline
User avatar

Bryan Ray

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

Re: very high res flow pipeline - toggle res advice

PostSat Oct 23, 2021 2:57 pm

Roei T wrote:thanks for the help so far, I need to dig into your website and exhausts the expression guidance (and other resources mentioned). coming from after effects, it seems the language is a bit similar, but not really.


Lua and Javascript are both derived from C++, so concepts and syntax are similar. They're related to one another much the same way as Spanish and Italian are.

(how do you properly tag users here?)


I don't think there's a tagging system in place. It requires installing an additional module that they don't have here.

what I would change if I new how (and I tried) is a combo controller instead of a button. because you can only chose one res each time. then I would like the scale factor to that combo. this way I only have to chose one thing.


You could push the Scale Factor into the control with the same button-press. And heck, as long as we're manipulating controls, you can get around the toggle problem by doing that with the script, too!

Code: Select all
{
   Tools = ordered() {
      ResizeMaster = BetterResize {
         CtrlWZoom = false,
         NameSet = true,
         Inputs = {
            UseFrameFormatSettings = Input { Value = 1, },
            Width = Input { Value = 4096, },
            Height = Input { Value = 4096, },
            HiQOnly = Input { Value = 0, },
            PixelAspect = Input { Value = { 1, 1 }, },
            FilterMethod = Input {
               Value = 8,
               Expression = "iif(ScaleFactor==0.5,8,0)",
            },
            ScaleFactor = Input { Value = 0.5, }
         },
         ViewInfo = OperatorInfo { Pos = { 1760, -49.5 } },
         Colors = { TileColor = { R = 0.666666666666667, G = 0, B = 0.498039215686275 }, },
         UserControls = ordered() {
            A = {
               INP_Integer = false,
               LINKID_DataType = "Number",
               BTNCS_Execute = [=[
               composition:SetPrefs({["Comp.FrameFormat.Width"]=8192, ["Comp.FrameFormat.Height"]=8192 })
               tool.ScaleFactor[composition.CurrentTime] = 1
               tool.UseFrameFormatSettings = 0
               tool.UseFrameFormatSettings = 1
               ]=],
               ICS_ControlPage = "Controls",
               INPID_InputControl = "ButtonControl",
               LINKS_Name = "8K"
            },
            B = {
               INP_Integer = false,
               LINKID_DataType = "Number",
               BTNCS_Execute = [=[
               composition:SetPrefs({["Comp.FrameFormat.Width"]=4096, ["Comp.FrameFormat.Height"]=4096 })
               tool.ScaleFactor[composition.CurrentTime] = 0.5
               tool.UseFrameFormatSettings = 0
               tool.UseFrameFormatSettings = 1
               ]=],
               ICS_ControlPage = "Controls",
               INPID_InputControl = "ButtonControl",
               LINKS_Name = "4K"
            },
            ScaleFactor = {
               INP_MaxAllowed = 1,
               INP_Integer = false,
               INPID_InputControl = "SliderControl",
               INP_MaxScale = 1,
               INP_MinScale = 0,
               INP_MinAllowed = 0,
               LINKID_DataType = "Number",
               ICS_ControlPage = "Controls",
               LINKS_Name = "Scale Factor"
            }
         }
      }
   },
   ActiveTool = "ResizeMaster"
}


A script run from a ButtonControl is a ToolScript, so it automatically defines the variable tool as the operator from which the script was executed. Thus, tool.ScaleFactor will always be the ScaleFactor control on the tool with the button.

Is your aspect ratio meant to be square? You have the same value for both Width and Height in the scripts.
Bryan Ray
http://www.bryanray.name
http://www.musevfx.com
Offline
User avatar

Roei T

  • Posts: 17
  • Joined: Mon Apr 26, 2021 7:24 pm
  • Location: Tel Aviv
  • Real Name: Roei Tzoref

Re: very high res flow pipeline - toggle res advice

PostSat Oct 23, 2021 4:46 pm

thanks again for the info.


Roei T wrote:Is your aspect ratio meant to be square? You have the same value for both Width and Height in the scripts.


it's VR stereo so yes 1:1 square.


Bryan Ray wrote:You could push the Scale Factor into the control with the same button-press. And heck, as long as we're manipulating controls, you can get around the toggle problem by doing that with the script, too!


thanks! I wondered how would I get the scale and frame default to be with the same control! since this is scripting, and I am new to expression in fusion, I couldn't find a way to rig them both. I see u did it in the button with the script. thanks for that. the res hack is nice but now that the scale is rigged into the frame default - I am thinking I don't realy need the res controls, they don't do anything and not rigged to anything so not really necessary and for me it served as an indication of what res I am in once I clicked the button - because you can't really tell....

so now I can think of maybe making a less crowded node. or just leave it. the thing that surprized me in fusion is that there is not "null" node just a clean node I can add and remove control as I wish, I also realized I can only remove the control that I added, not the native ones. so I just look for the node that has the least amount of controls or the one that makes the most sense.

one more thing I forgot to ask. before you said that effects that are resolution dependent can trip. I had that with FL DOF. but only that. you said something about gain I didn't guite get. was it gain for color correction? and you said 32bit float. this is maybe offtopic, but I generally work in 16float and use 32bit in specific cases (of which I haven't came across yet). examining my comp and comparing shows no difference with seeing the scopes too (got glows, blurs, FL DOF, color correction and watching the downres version right now)|
Offline
User avatar

Bryan Ray

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

Re: very high res flow pipeline - toggle res advice

PostSat Oct 23, 2021 8:10 pm

Roei T wrote:so now I can think of maybe making a less crowded node. or just leave it. the thing that surprized me in fusion is that there is not "null" node just a clean node I can add and remove control as I wish,


There's a Null Fuse. I'm not sure if it's in Reactor or not, but you can download it from the old VFXPedia archived at WSL:
https://www.steakunderwater.com/VFXPedi ... mple_Fuses

Remember that it'll need to be visible to your render nodes, too, or they'll throw an error on loading the comp. I've actually stopped using it for that reason. I usually just make a pair of BrightnessContrast nodes, group them, and put my new controls on the group. You need two nodes to quickly make a group, and BC is, I believe, the fastest tool.

one more thing I forgot to ask. before you said that effects that are resolution dependent can trip. I had that with FL DOF. but only that. you said something about gain I didn't guite get. was it gain for color correction? and you said 32bit float. this is maybe offtopic, but I generally work in 16float and use 32bit in specific cases (of which I haven't came across yet). examining my comp and comparing shows no difference with seeing the scopes too (got glows, blurs, FL DOF, color correction and watching the downres version right now)|


I was referring to optical flow or other motion vectors. These vectors are pixel-relative. That is, if you have a value of +3.5 in the VectorX channel (usually Red when converted to RGBA), that represents a movement of 3.5 pixels to the right (positive X). If you were to resize the vectors, say Scaling by 0.5, that vector still represents 3.5 pixels, so whatever you're applying the vectors to will get twice as much as it should.

To counteract this, if you Scale by 0.5, you should also Gain the vectors by 0.5, so the new value will be 1.75, and when applied it will be spatially correct. From a vector standpoint, Scale and Gain are the same thing—they're both simply multiplication.

Of course, if your vectors are being generated post-scale, you wouldn't need to worry about it, but it's typical to pre-render optical flow because it's expensive. If you did so, you'd need to realize that you have to scale the vectors themselves and not just the raster they're contained in.

As for the bit depth, you usually only need 32-bit for these technical buffers, like motion vectors, world position, and z-depth.
Bryan Ray
http://www.bryanray.name
http://www.musevfx.com
Offline
User avatar

Roei T

  • Posts: 17
  • Joined: Mon Apr 26, 2021 7:24 pm
  • Location: Tel Aviv
  • Real Name: Roei Tzoref

Re: very high res flow pipeline - toggle res advice

PostSun Oct 24, 2021 9:16 am

Bryan Ray wrote:I usually just make a pair of BrightnessContrast nodes, group them, and put my new controls on the group.


great idea! thanks. now I can save it as a macro so I have a null tool :)

*edit: after discussion in the discord I see a problem where you can't see the keyframes in the kf/spline editor...

all the other info is clear now.

thanks for everything Brian.
Offline
User avatar

TheBloke

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

Re: very high res flow pipeline - toggle res advice

PostSun Oct 24, 2021 9:42 am

Bryan Ray wrote:I usually just make a pair of BrightnessContrast nodes, group them, and put my new controls on the group. You need two nodes to quickly make a group, and BC is, I believe, the fastest tool.
When doing some testing the other day I found that you can put controls on PipeRouters. Not through the UI, but it works fine if you manually copy them on outside of Fusion (same as you have to do for a Group I guess).

Image

I didn't test network rendering, but at least in a Fusion UI render test, a PipeRouter with custom controls, referenced in expressions on other nodes, seemed to work fine. Including when the PipeRouter is set to PassThrough, which I guess would have the absolute minimum impact on throughput (hopefully at least!)

Though I guess you could just passthrough any node, like the BC, and it would (again, hopefully) perform identically. The PipeRouter method does have some disadvantages, like the inability to pin a PipeRouter in the Inspector, and no ability to Edit Controls inside the UI (though the latter also applies to a group.)

If there's any doubt about impacting performance when using nodes just for controls, maybe you could combine your two-node Group method with passed-through PipeRouters instead:
Image
Resolve Studio 17.4.2 and Fusion Studio 17.4.2 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
User avatar

Bryan Ray

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

Re: very high res flow pipeline - toggle res advice

PostSun Oct 24, 2021 4:27 pm

Chad did some performance testing with PipeRouters and discovered that for some reason they're actually slower than BrightnessContrast if not bypassed.

My supervisor also claims that PipeRouters have occasionally created other, unspecific issues. One of the first things he does when troubleshooting a comp is to remove them all. I don't know what sins they committed against him in the past, but he's quite ruthless with them now! :lol:
Bryan Ray
http://www.bryanray.name
http://www.musevfx.com
Offline
User avatar

TheBloke

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

Re: very high res flow pipeline - toggle res advice

PostSun Oct 24, 2021 8:58 pm

Bryan Ray wrote:Chad did some performance testing with PipeRouters and discovered that for some reason they're actually slower than BrightnessContrast if not bypassed.

My supervisor also claims that PipeRouters have occasionally created other, unspecific issues.
Ah yeah I've heard that there was a PipeRouter bug where it killed performance. I think it's been fixed though. I did some testing in 17.3 I think it was - few weeks ago - and couldn't notice any significant performance impact to a PipeRouter versus other nodes.

I just did a more complete test in Fu 17.4.

Base setup:
- int8 Background in 4-corner-gradient, TopLeftRed animated from 1.0 to 0.0 over 1000 frames
- Saver to Uncompressed 8-bit MOV on 2x2TB NVMe RAID 0

Image

Brightness/Contrast setup:
- Same, but with 100 x BC nodes in-between
Image

PipeRouter setup
- Same, with 100 x PipeRouter in-between
Image

I did the following renders using the UI Render button, with nothing in the viewers. Between each render, I Purged Cache. And before the start of each new test group, I deleted the mov file on disk.

- 5 x base setup
- 5 x BC nodes (all BC nodes enabled)
- 5 x BC nodes (all BC nodes pass-through)
- 5 x PipeRouter (all enabled)
- 5 x PipeRouter (all pass-through)

Results:
Image

- The cost of one Brightness/Contrast node is 1 FPS.
- This drops to 0.9 FPS if all BCs are pass-through.
- The cost of one PipeRouter is 0.86 FPS
- Dropping to 0.84 FPS if all are pass-through.

So based on these results I would say PipeRouters are OK as a method of holding controls, if someone wanted to do that. They're slightly better than a BC node in that regard. And in either case, it's marginally worthwhile making any such nodes pass-through.

But I can understand why your supervisor hates them. I find it really weird and annoying that a PipeRouter has ANY cost. Until I first heard about the performance bug, I always assumed that the PR was simply a helper in the UI, and that behind the scenes the image pipeline just ignored them completely; that it treated a connection that goes node1 -> PR -> node2 as actually being node1 -> node2. It's annoying when useful UI features turn out to have a real-world performance cost.
Resolve Studio 17.4.2 and Fusion Studio 17.4.2 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
User avatar

Bryan Ray

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

Re: very high res flow pipeline - toggle res advice

PostSun Oct 24, 2021 9:20 pm

That's good to know! Thanks for running the tests.
Bryan Ray
http://www.bryanray.name
http://www.musevfx.com
Offline

Sander de Regt

  • Posts: 2386
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: very high res flow pipeline - toggle res advice

PostMon Oct 25, 2021 5:45 am

You're so thorough, Tom. Impressive.
Sander de Regt

ShadowMaker SdR
The Netherlands

Return to Fusion

Who is online

Users browsing this forum: crtkecnkl659, jfykeaucq871 and 9 guests