Jump to: Board index » General » Fusion

Flag Simulation - How to exchange the flag texture?

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

Bernhard Rieder

  • Posts: 115
  • Joined: Tue Aug 04, 2015 6:49 pm

Flag Simulation - How to exchange the flag texture?

PostMon Jul 10, 2017 2:46 pm

Hi there!

I am simulating a flag animation within 3dsmax.
The simulation is cached out, and I can use several different flag textures for render.

However... thinking if there wouldn't be a way for the FUSION Comp... to exchange the texture map... and not re-rendering every flag over and over again.

Is there any option, node, feature or possibility to just exchange the flag texture in post?
so I do NOT need to re-render every single flag over and over again?

Hmm... thank you for any little help & maybe a how to,
appreciate it!
Offline
User avatar

Andrew Hazelden

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

Re: Flag Simulation - How to exchange the flag texture?

PostMon Jul 10, 2017 3:54 pm

Hi. What you are looking for is called a "UV pass" render element in 3DS Max. This UV pass approach allows you to re-texture the object in a compositing package. The "Texture" node in Fusion allows you to replace the texture on your rendered image using the red to green shaded UV pass channel data in your 3DS Max rendered EXR image.

Replacing a flag texture.png
Replacing a Flag Texture using a UV Pass Channel
Replacing a flag texture.png (449.34 KiB) Viewed 1935 times


In Fusion you will find the Texture node under the Tools > Deep Pixel > Texture menu.

Texture Node Usage:

Step 1. Start by adding a Texture node to your composite.

Step 2. Connect your 3DS Max rendered multi-channel RGBA + UV pass image to the Texture node's "Input" connection. You can also connect the alpha channel from the multi-channel image to the Texture node's EffectMask if you want.

Step 3. Connect your new "replacement" flag image to the Texture node's "Texture" connection.

Sample Fusion UV Pass Re-texturing Comp:

Code: Select all
{
   Tools = ordered() {
      Texture1 = Texture {
         CtrlWZoom = false,
         Inputs = {
            Input = Input {
               SourceOp = "Loader2",
               Source = "Output",
            },
            Texture = Input {
               SourceOp = "ReplacedFlagBackgound",
               Source = "Output",
            },
            EffectMask = Input {
               SourceOp = "Loader2",
               Source = "Output",
            }
         },
         ViewInfo = OperatorInfo { Pos = { 660, 115.5 } },
      },
      ReplacedFlagBackgound = Background {
         NameSet = true,
         Inputs = {
            GlobalOut = Input { Value = 0, },
            Width = Input { Value = 3840, },
            Height = Input { Value = 1920, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Type = Input { Value = FuID { "Gradient" }, },
            Start = Input { Value = { 0.5, 0 }, },
            End = Input { Value = { 0.5, 1 }, },
            Gradient = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 1, 0.8, 0, 1 },
                     [0.3277591973244] = { 1, 0.8, 0, 1 },
                     [0.34] = { 0.81, 0, 0.015, 1 },
                     [0.66] = { 0.81, 0, 0.015, 1 },
                     [0.67] = { 0, 0, 0, 1 }
                  }
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 660, 49.5 } },
      },
      Loader2 = Loader {
         Clips = {
            Clip {
               ID = "Clip1",
               Filename = "Comp:/flag.0000.exr",
               FormatID = "OpenEXRFormat",
               LengthSetManually = true,
               TrimIn = 0,
               TrimOut = 0,
               ExtendFirst = 0,
               ExtendLast = 0,
               Loop = 0,
               AspectMode = 0,
               Depth = 0,
               TimeCode = 0,
               GlobalStart = 0,
               GlobalEnd = 0
            }
         },
         Inputs = {
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            ["Clip1.OpenEXRFormat.Channels"] = Input { Value = 1, },
            ["Clip1.OpenEXRFormat.RedName"] = Input { Value = FuID { "R" }, },
            ["Clip1.OpenEXRFormat.GreenName"] = Input { Value = FuID { "G" }, },
            ["Clip1.OpenEXRFormat.BlueName"] = Input { Value = FuID { "B" }, },
            ["Clip1.OpenEXRFormat.AlphaName"] = Input { Value = FuID { "A" }, },
            ["Clip1.OpenEXRFormat.UName"] = Input { Value = FuID { "U" }, },
            ["Clip1.OpenEXRFormat.VName"] = Input { Value = FuID { "V" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 495, 115.5 } },
      },
      Note1 = Note {
         Inputs = {
            Comments = Input { Value = "This example shows how you can use the Texture node as part of a Fusion based UV Pass remapping approach to replace the texture map in a multi-channel EXR image.", }
         },
         ViewInfo = StickyNoteInfo {
            Pos = { 436.676, -67.5417 },
            Flags = {
               Expanded = true
            },
            Size = { 485, 80.3 }
         },
      }
   }
}


Sample Flag EXR Multi-Channel Image:
Sample Flag EXR Image.zip
Flag RGBA + UV Pass Multi-Channel EXR Image
(725.84 KiB) Downloaded 125 times


Fusion UV Pass Documentation

The Texture node and UV Texture channels are mentioned briefly on page 425 and 431 of the Fusion 8 User manual.pdf:

UV Texture
The UV Texture channels contain information about mapping coordinates for each pixel in the scene. This is used to apply textures wrapped to the object.

Texture
The Texture tool uses the UV channels to apply an image from the second input as a texture. This can replace textures on a specific object when used in conjunction with the object ID or material ID masks.

The Texture Tool is also mentioned on page 305 of the Fusion 8 Tool Manual.pdf file:

Texture
The Texture tool can control the texture mapping of elements in a rendered image. The texture- map image (connected to the green input) can be wrapped around objects to replace the current texture. The Texture tool relies on the presence of U and V Map channels in 3D rendered images. If these channels are not present, this tool has no effect.

Note: Background pixels may have U and V values of 0.0, which will set those pixels to the color of the texture’s corner pixel. To restrict texturing to specific objects, use an effect mask based on the alpha of the object, or its Object or Material ID channel. For more information, see the Auxiliary Channels chapter.

Swap UV
When this checkbox is selected the U and V channels of the source image are swapped.

Flip Horizontal and Vertical
The texture-map image is flipped horizontally and/or vertically when this control is toggled on.

Rotate 90
The texture-map image is rotated 90 degrees when this checkbox is enabled.

U and V Scale
These controls change the scaling of the U and V coordinates used to map the texture. Changing these values effectively enlarges and shrinks the texture map as it is applied.

U and V Offset
Adjust these controls to offset the U and V coordinates. Changing the values causes the texture to appear to move along the geometry of the object.
Last edited by Andrew Hazelden on Mon Jul 10, 2017 5:33 pm, edited 2 times in total.
Reactor.lua:933: attempt to index global 'ui' (a nil value)
Offline
User avatar

Chad Capeland

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

Re: Flag Simulation - How to exchange the flag texture?

PostMon Jul 10, 2017 5:16 pm

I'd suggest outputting the mesh with either Alembic animation or a 3D displacement map. That way you don't have to worry about issues where the mesh overlaps in camera space and you have ambiguous UV's.

Even if you render out the rest of your scene elsewhere, you can still match up well if you export a camera and possibly some lighting passes.
Chad Capeland
Indicated, LLC
www.floweffects.com

Return to Fusion

Who is online

Users browsing this forum: No registered users and 22 guests