Jump to: Board index » General » Fusion

pCustom - expressions with tan in render3D

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

Okke Verbart

  • Posts: 290
  • Joined: Tue Jan 17, 2017 8:40 pm

pCustom - expressions with tan in render3D

PostMon Feb 06, 2017 8:56 am

Hi - In my continued experiments with pCustom I came across a bit of a bewildering thing: It seems that -at least on my computer- that if I use the "tan" function in an expression in pCustom the output from the Render3D node starts behaving erratically: sometimes showing nothing, at other times showing some frames but not all. Prior to the renderer everything shows as expected! There is no such erratic behaviour when using cos or sin functions? I see this with both the software and the openGL renderer.

Can someone verify this behaviour on their setup?

Very simple example (with a tan function used in the "Position X expression" on the particle tab in the pCustom node) that shows an issue for me (I set to merge node to be viewed on viewport 1 and the renderer node on viewport 2).

Code: Select all
{
   Tools = ordered() {
      Camera3D1 = Camera3D {
         Inputs = {
            ["Transform3DOp.Translate.Y"] = Input { Value = 0.707106793288165, },
            ["Transform3DOp.Translate.Z"] = Input { Value = 1.22474489235221, },
            ["Transform3DOp.Rotate.X"] = Input { Value = -30, },
            FLength = Input { Value = 18.2123442718302, },
            ["Stereo.Mode"] = Input { Value = FuID { "Mono" }, },
            FilmGate = Input { Value = FuID { "BMD_URSA_4K_16x9" }, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 2, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 2, },
         },
         ViewInfo = OperatorInfo { Pos = { 589, 252 } },
      },
      Merge3D1 = Merge3D {
         Inputs = {
            SceneInput1 = Input {
               SourceOp = "pRender1",
               Source = "Output",
            },
            SceneInput2 = Input {
               SourceOp = "Camera3D1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 574, 56 } },
      },
      Renderer3D1 = Renderer3D {
         Inputs = {
            GlobalOut = Input { Value = 100, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            SceneInput = Input {
               SourceOp = "Merge3D1",
               Source = "Output",
            },
            RendererType = Input { Value = FuID { "RendererOpenGL" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 683, 60 } },
      },
      pRender1 = pRender {
         Inputs = {
            ["_MotionBlurWarning"] = Input { Disabled = true, },
            GlobalOut = Input { Value = 100, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            OutputMode = Input { Disabled = true, },
            IntegrationMethod = Input { Value = FuID { "RK4" }, },
            ["MaterialID.MaterialID"] = Input { Value = 1, },
            ["ObjectID.ObjectID"] = Input { Value = 1, },
            Input = Input {
               SourceOp = "pCustom1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 346, 57 } },
      },
      pEmitter1 = pEmitter {
         ID = 9,
         CtrlWZoom = false,
         Inputs = {
            Style = Input { Value = FuID { "ParticleStyleBlob" }, },
            ["ParticleStyle.ColorOverLife"] = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 1, 1, 1, 1 }
                  }
               },
            },
            ["ParticleStyle.SizeOverLife"] = Input {
               SourceOp = "pEmitter1SizeoverLife",
               Source = "Value",
            },
            ["ParticleStyle.BlurOverLife"] = Input {
               SourceOp = "pEmitter1BluroverLife2D",
               Source = "Value",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 35, 53 } },
      },
      pEmitter1SizeoverLife = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0.5, RH = { 0.3, 0.5 }, Flags = { Linear = true } },
               [1] = { 0.5, LH = { 0.7, 0.5 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 192, Green = 128, Blue = 64 },
         NameSet = true,
      },
      pEmitter1BluroverLife2D = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0.5, RH = { 0.3, 0.5 }, Flags = { Linear = true } },
               [1] = { 0.5, LH = { 0.7, 0.5 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 192, Green = 128, Blue = 64 },
         NameSet = true,
      },
      pCustom1 = pCustom {
         ID = 13,
         Inputs = {
            PositionXExpression = Input { Value = "tan(time+id)", },
            Input = Input {
               SourceOp = "pEmitter1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 145, 53 } },
      }
   }
}


Whereas the following example doesn't exhibit an issue for me (replaced the tan with a sin in the expression):

Code: Select all
{
   Tools = ordered() {
      Camera3D1 = Camera3D {
         Inputs = {
            ["Transform3DOp.Translate.Y"] = Input { Value = 0.707106793288165, },
            ["Transform3DOp.Translate.Z"] = Input { Value = 1.22474489235221, },
            ["Transform3DOp.Rotate.X"] = Input { Value = -30, },
            FLength = Input { Value = 18.2123442718302, },
            ["Stereo.Mode"] = Input { Value = FuID { "Mono" }, },
            FilmGate = Input { Value = FuID { "BMD_URSA_4K_16x9" }, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 2, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 2, },
         },
         ViewInfo = OperatorInfo { Pos = { 589, 252 } },
      },
      Merge3D1 = Merge3D {
         Inputs = {
            SceneInput1 = Input {
               SourceOp = "pRender1",
               Source = "Output",
            },
            SceneInput2 = Input {
               SourceOp = "Camera3D1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 574, 56 } },
      },
      Renderer3D1 = Renderer3D {
         Inputs = {
            GlobalOut = Input { Value = 100, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            SceneInput = Input {
               SourceOp = "Merge3D1",
               Source = "Output",
            },
            RendererType = Input { Value = FuID { "RendererOpenGL" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 683, 60 } },
      },
      pCustom1 = pCustom {
         ID = 13,
         CtrlWZoom = false,
         Inputs = {
            PositionXExpression = Input { Value = "sin(time+id)", },
            Input = Input {
               SourceOp = "pEmitter1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 145, 53 } },
      },
      pRender1 = pRender {
         Inputs = {
            ["_MotionBlurWarning"] = Input { Disabled = true, },
            GlobalOut = Input { Value = 100, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            OutputMode = Input { Disabled = true, },
            IntegrationMethod = Input { Value = FuID { "RK4" }, },
            ["MaterialID.MaterialID"] = Input { Value = 1, },
            ["ObjectID.ObjectID"] = Input { Value = 1, },
            Input = Input {
               SourceOp = "pCustom1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 346, 57 } },
      },
      pEmitter1 = pEmitter {
         ID = 9,
         Inputs = {
            Style = Input { Value = FuID { "ParticleStyleBlob" }, },
            ["ParticleStyle.ColorOverLife"] = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 1, 1, 1, 1 }
                  }
               },
            },
            ["ParticleStyle.SizeOverLife"] = Input {
               SourceOp = "pEmitter1SizeoverLife",
               Source = "Value",
            },
            ["ParticleStyle.BlurOverLife"] = Input {
               SourceOp = "pEmitter1BluroverLife2D",
               Source = "Value",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 35, 53 } },
      },
      pEmitter1SizeoverLife = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0.5, RH = { 0.3, 0.5 }, Flags = { Linear = true } },
               [1] = { 0.5, LH = { 0.7, 0.5 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 192, Green = 128, Blue = 64 },
         NameSet = true,
      },
      pEmitter1BluroverLife2D = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0.5, RH = { 0.3, 0.5 }, Flags = { Linear = true } },
               [1] = { 0.5, LH = { 0.7, 0.5 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 192, Green = 128, Blue = 64 },
         NameSet = true,
      }
   }
}
www.ablackbirdcalledsue.com
Offline
User avatar

Chad Capeland

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

Re: pCustom - expressions with tan in render3D

PostMon Feb 06, 2017 5:11 pm

You need to clamp the value.
Chad Capeland
Indicated, LLC
www.floweffects.com
Offline

Okke Verbart

  • Posts: 290
  • Joined: Tue Jan 17, 2017 8:40 pm

Re: pCustom - expressions with tan in render3D

PostMon Feb 06, 2017 5:50 pm

Thanks Chad. Could you elaborate on this? Are you talking about clamping the value of X position (with something like a Min function).
www.ablackbirdcalledsue.com
Offline

Okke Verbart

  • Posts: 290
  • Joined: Tue Jan 17, 2017 8:40 pm

Re: pCustom - expressions with tan in render3D

PostMon Feb 06, 2017 6:00 pm

Actually, I just tried clamping it with a Min function and it works....Now that I think about it, this makes sense when working with a tan function...infinity and all...

Thanks Chad!
www.ablackbirdcalledsue.com
Offline
User avatar

Chad Capeland

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

Re: pCustom - expressions with tan in render3D

PostTue Feb 07, 2017 7:16 am

Need min and max as it can be positive or negative, but you get the idea.
Chad Capeland
Indicated, LLC
www.floweffects.com
Offline

Okke Verbart

  • Posts: 290
  • Joined: Tue Jan 17, 2017 8:40 pm

Re: pCustom - expressions with tan in render3D

PostTue Feb 07, 2017 5:02 pm

Yeh, I got that indeed! Thx again Chad!
www.ablackbirdcalledsue.com

Return to Fusion

Who is online

Users browsing this forum: pontmarius and 43 guests