Jump to: Board index » General » Fusion

No Luck With Texture Tool

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

JakeBogan

  • Posts: 3
  • Joined: Mon Jul 17, 2017 9:01 pm

No Luck With Texture Tool

PostTue Jul 18, 2017 6:30 pm

Hey guys,

I have been working on this flag simulation where in post I can replace the texture of the flag but I am having no luck with this actually working for me. I have attached my comp to this, any help is very much appreciated. thank you!
Attachments
Flag_ReplaceTextures.zip
(2.59 KiB) Downloaded 79 times
Offline
User avatar

Bryan Ray

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

Re: No Luck With Texture Tool

PostTue Jul 18, 2017 8:47 pm

First, you shouldn't need any gamma correction on your UV buffer—it should be linear, regardless of how you might have the RGB buffer from your 3d software set up.

Next, your ChannelBooleans is copying the UV channels into RGB. That actually shouldn't matter too much since you're replacing RGB with the new texture anyway, but it's one more thing to watch out for.

Since you've already masked off your inputs, you don't need to mask the Texture tool.

Finally, I'm not certain what that MatteControl is for. It's not set to do anything. You could pipe your alpha into it at the end to treat the poorly filtered edges you'll get from using Texture, though.

Without having access to your actual images, that's as much guidance as I can offer. I replaced the images with some Background tools to test things out, and it seems to be working.

Incidentally, if you are just uploading a comp, you don't need to zip it. You can just copy-and-paste your nodes directly into the forum between some code tags, like so:

Code: Select all
{
   Tools = ordered() {
      U_channel = Background {
         NameSet = true,
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Type = Input { Value = FuID { "Horizontal" }, },
            TopRightRed = Input { Value = 1, },
            Gradient = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0, 0, 0, 1 },
                     [1] = { 1, 1, 1, 1 }
                  }
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 770, 214.5 } },
      },
      V_channel = Background {
         NameSet = true,
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Type = Input { Value = FuID { "Vertical" }, },
            TopLeftGreen = Input { Value = 1, },
            Gradient = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0, 0, 0, 1 },
                     [1] = { 1, 1, 1, 1 }
                  }
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 770, 247.5 } },
      },
      Texture1 = Texture {
         Inputs = {
            Input = Input {
               SourceOp = "Shuffle_UV_into_Flow",
               Source = "Output",
            },
            Texture = Input {
               SourceOp = "Texture",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1155, 379.5 } },
      },
      Original_render = Background {
         CtrlWZoom = false,
         NameSet = true,
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Type = Input { Value = FuID { "Gradient" }, },
            GradientType = Input { Value = FuID { "Radial" }, },
            Start = Input { Value = { 0.508771929824561, 0.493769470404984 }, },
            Gradient = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0.933333333333333, 0, 0, 1 },
                     [1] = { 1, 1, 0.139393939393939, 1 }
                  }
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 770, 379.5 } },
      },
      UV_map = ChannelBoolean {
         NameSet = true,
         CustomData = {
            Settings = {
               [1] = {
                  Tools = ordered() {
                     ChannelBooleans1_1 = ChannelBoolean {
                        Inputs = {
                           Background = Input {
                              SourceOp = "RsAmbientOcclusion_090_MonumentValley_Car_BTY_",
                              Source = "Output"
                           }
                        },
                        Name = "ChannelBooleans1_1",
                        CtrlWZoom = false,
                        ViewInfo = OperatorInfo { Pos = { 440, -313.5 } },
                        CustomData = {
                        }
                     }
                  }
               },
               [2] = {
                  Tools = ordered() {
                     ChannelBooleans1 = ChannelBoolean {
                        Inputs = {
                           Operation = Input { Value = 1 },
                           ToAlpha = Input { Value = 4 }
                        },
                        CtrlWZoom = false,
                        ViewInfo = OperatorInfo { Pos = { 1265, 181.5 } },
                        CustomData = {
                        }
                     }
                  }
               },
               [3] = {
                  Tools = ordered() {
                     ChannelBooleans1 = ChannelBoolean {
                        Inputs = {
                           Operation = Input { Value = 2 },
                           ToAlpha = Input { Value = 4 }
                        },
                        CtrlWZoom = false,
                        ViewInfo = OperatorInfo { Pos = { 1265, 181.5 } },
                        CustomData = {
                        }
                     }
                  }
               },
               [4] = {
                  Tools = ordered() {
                     ChannelBooleans1 = ChannelBoolean {
                        Inputs = {
                           Operation = Input { Value = 6 },
                           ToAlpha = Input { Value = 4 }
                        },
                        CtrlWZoom = false,
                        ViewInfo = OperatorInfo { Pos = { 1265, 181.5 } },
                        CustomData = {
                        }
                     }
                  }
               },
               [5] = {
                  Tools = ordered() {
                     ChannelBooleans1_1 = ChannelBoolean {
                        Inputs = {
                           ToRed = Input { Value = 3 },
                           ToGreen = Input { Value = 3 },
                           Operation = Input { Value = 7 },
                           Background = Input {
                              SourceOp = "RsAmbientOcclusion_090_MonumentValley_Car_BTY_",
                              Source = "Output"
                           },
                           ToBlue = Input { Value = 3 },
                           ToAlpha = Input { Value = 4 }
                        },
                        CtrlWZoom = false,
                        ViewInfo = OperatorInfo { Pos = { 440, -313.5 } },
                        CustomData = {
                        }
                     }
                  }
               },
            }
         },
         Inputs = {
            ToGreen = Input { Value = 6, },
            ToBlue = Input { Value = 15, },
            ToAlpha = Input { Value = 16, },
            Background = Input {
               SourceOp = "V_channel",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "U_channel",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 880, 247.5 } },
      },
      Texture = Background {
         NameSet = true,
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Type = Input { Value = FuID { "Gradient" }, },
            GradientType = Input { Value = FuID { "Cross" }, },
            Start = Input { Value = { 0.507014028056112, 0.5 }, },
            Gradient = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0, 0, 0, 1 },
                     [1] = { 1, 1, 1, 1 }
                  }
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1155, 247.5 } },
      },
      Shuffle_UV_into_Flow = ChannelBoolean {
         NameSet = true,
         Inputs = {
            ToRed = Input { Value = 4, },
            ToGreen = Input { Value = 4, },
            ToBlue = Input { Value = 4, },
            ToAlpha = Input { Value = 4, },
            EnableExtraChannels = Input { Value = 1, },
            ToUTexture = Input { Value = 0, },
            ToVTexture = Input { Value = 1, },
            Background = Input {
               SourceOp = "Original_render",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "UV_map",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 880, 379.5 } },
      }
   }
}
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

JakeBogan

  • Posts: 3
  • Joined: Mon Jul 17, 2017 9:01 pm

Re: No Luck With Texture Tool

PostTue Jul 18, 2017 9:45 pm

Thank you for your reply! Your method seemed to actually help a lot, the other issue I am just running into is how gritty it looks when replacing the texture. Sorry for all the questions and what not, I am relatively new at this software. I have attached the file here with the actual images I used for the comp here.
Offline
User avatar

Bryan Ray

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

Re: No Luck With Texture Tool

PostWed Jul 19, 2017 12:34 am

Yeah, the Texture tool doesn't produce the most beautiful results. You can often improve it by super sampling, though. Use a Scale node to scale everything up to twice its original size, then Scale immediately after the Texture by 0.5. The Scale's filtering will smooth out the result, but it will be slower because you're doing four times as much calculation. Sometimes a small blur right before the scale down, then a very slight sharpen afterward can also help.
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline
User avatar

Andrew Hazelden

  • Posts: 536
  • Joined: Sat Dec 06, 2014 12:10 pm
  • Location: West Dover, Nova Scotia, Canada

Re: No Luck With Texture Tool

PostWed Jul 19, 2017 6:33 am

As an additional note the UV pass channel data has to be stored as either 16 bit integer or 32 bit float channel data.

If you were to extract and save the UV pass channels in an 8 bit image format/frame buffer you would only be able to remap a 256 pixel wide image since the red/green color values are used to do the texture remapping.
Mac Studio M2 Ultra / Threadripper 3990X | Fusion Studio 18.6.4 | Kartaverse 6

Return to Fusion

Who is online

Users browsing this forum: No registered users and 47 guests