Jump to: Board index » General » Fusion

Easiest way to normalize Z channel from Render3D

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

Scott Turner

  • Posts: 23
  • Joined: Sun Feb 12, 2017 4:58 pm

Easiest way to normalize Z channel from Render3D

PostMon Sep 03, 2018 5:07 pm

so i guess the info coming out of render3D is not in 0-1 range as required by depth blur node. Is there an easy way (noce) to accomplish this? I find autogain node useful sometimes on imported z passes but doesnt seem to do the trick coming from render3D.
Offline

Okke Verbart

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

Re: Easiest way to normalize Z channel from Render3D

PostMon Sep 03, 2018 7:52 pm

I'm sure someone has got an easier way, but if not, you can always use the custom tool after the 3d renderer. Put in a normalisation formula for the z channel. In the example below, I used one that makes use of the numbers tab where I manually set the min and max of the z input.

Code: Select all
{
   Tools = ordered() {
      Camera3D1 = Camera3D {
         Inputs = {
            AoV = Input { Value = 19.2642683071402, },
            ["Stereo.Mode"] = Input { Value = FuID { "OffAxis" }, },
            FilmGate = Input { Value = FuID { "BMD_URSA_4K_16x9" }, },
            ApertureW = Input { Value = 0.831496062992126, },
            ApertureH = Input { Value = 0.467716535433071, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 3, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 2, },
         },
         ViewInfo = OperatorInfo { Pos = { 625, 178 } },
      },
      Renderer3D1 = Renderer3D {
         CustomData = {
            ToolVersion = 2,
         },
         Inputs = {
            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" }, },
            ["RendererOpenGL.Channels.Nest"] = Input { Value = 1, },
            ["RendererOpenGL.Channels.Z"] = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 896, 144 } },
      },
      CustomTool1 = Custom {
         CtrlWZoom = false,
         Inputs = {
            NumberIn1 = Input { Value = -9, },
            NumberIn2 = Input { Value = -5.77, },
            LUTIn1 = Input {
               SourceOp = "CustomTool1LUTIn1",
               Source = "Value",
            },
            LUTIn2 = Input {
               SourceOp = "CustomTool1LUTIn2",
               Source = "Value",
            },
            LUTIn3 = Input {
               SourceOp = "CustomTool1LUTIn3",
               Source = "Value",
            },
            LUTIn4 = Input {
               SourceOp = "CustomTool1LUTIn4",
               Source = "Value",
            },
            AuxChannelNest = Input { Value = 1, },
            ZExpression = Input { Value = "(z1-n1)/(n2-n1)", },
            Image1 = Input {
               SourceOp = "Renderer3D1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1006, 144 } },
      },
      CustomTool1LUTIn1 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 204, Green = 0, Blue = 0 },
         NameSet = true,
      },
      CustomTool1LUTIn2 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 0, Green = 204, Blue = 0 },
         NameSet = true,
      },
      CustomTool1LUTIn3 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 0, Green = 0, Blue = 204 },
         NameSet = true,
      },
      CustomTool1LUTIn4 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 204, Green = 204, Blue = 204 },
         NameSet = true,
      },
      Shape3D1 = Shape3D {
         Inputs = {
            ["Transform3DOp.Translate.Z"] = Input { Value = -6.77257321952253, },
            Shape = Input { Value = FuID { "SurfaceSphereInputs" }, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 1, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1, },
            ["SurfaceSphereInputs.ObjectID.ObjectID"] = Input { Value = 2, }
         },
         ViewInfo = OperatorInfo { Pos = { 625, 145 } },
      },
      Merge3D1 = Merge3D {
         Inputs = {
            SceneInput1 = Input {
               SourceOp = "Shape3D1",
               Source = "Output",
            },
            SceneInput2 = Input {
               SourceOp = "Camera3D1",
               Source = "Output",
            },
            SceneInput3 = Input {
               SourceOp = "Shape3D2",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 784, 144 } },
      },
      Shape3D2 = Shape3D {
         Inputs = {
            ["Transform3DOp.Translate.Z"] = Input { Value = -8.96522410449996, },
            ["MtlStdInputs.Diffuse.Color.Green"] = Input { Value = 0, },
            ["MtlStdInputs.Diffuse.Color.Blue"] = Input { Value = 0, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 3, },
            ["SurfacePlaneInputs.Width"] = Input { Value = 10, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 4, }
         },
         ViewInfo = OperatorInfo { Pos = { 807, 68 } },
      }
   }
}
www.ablackbirdcalledsue.com
Offline
User avatar

Chad Capeland

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

Re: Easiest way to normalize Z channel from Render3D

PostMon Sep 03, 2018 9:39 pm

Scott Turner wrote:so i guess the info coming out of render3D is not in 0-1 range as required by depth blur node. Is there an easy way (noce) to accomplish this? I find autogain node useful sometimes on imported z passes but doesnt seem to do the trick coming from render3D.


Why do you think it needs to be 0-1?
Chad Capeland
Indicated, LLC
www.floweffects.com
Offline

Scott Turner

  • Posts: 23
  • Joined: Sun Feb 12, 2017 4:58 pm

Re: Easiest way to normalize Z channel from Render3D

PostTue Sep 04, 2018 3:36 pm

ha i dont ...but someone said it on a youtube video. still i have a real difficult time getting anything useable/controllable so it made sense. all i want is simple controllable DOF wher i set a depth and it looks good. ive been bullshitting it for years when i use fusion and its got to stop lol

Return to Fusion

Who is online

Users browsing this forum: No registered users and 33 guests