Jump to: Board index » General » Fusion

Help me understand the Z depth and Depth blur

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

David Kibui

  • Posts: 19
  • Joined: Fri Dec 30, 2016 7:57 am

Help me understand the Z depth and Depth blur

PostTue Aug 08, 2017 4:32 pm

Hello everyone,

I have been experimenting with 3D scenes in Fusion and I just don't seem to get how to derive Z depth map from the scene. I have output the Z channel in the render node but when I check the Z channel after the render, the channel is all white. Please someone help me demistify this!

I feel it's important to be able to see the Z channel so that I can visually apply depth blur to the scene. As it is now, the blur is covering areas that I need to be in perfect focus. I have also attempted to use the Channel Booleans tool to extract the Z channel form the rendered image without success! I am not totally confident in my knowledge of the Channel Booleans tool but I have experimented a bit ;) ;)

Any help is highly appreciated. Please see my scene below.

Code: Select all
{
   Tools = ordered() {
      Background1 = Background {
         Inputs = {
            GlobalOut = Input { Value = 100, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input { Value = 0.713, },
            Gradient = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0, 0, 0, 1 },
                     [1] = { 1, 1, 1, 1 }
                  }
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { -110, 49.5 } },
      },
      Shape3D1 = Shape3D {
         Inputs = {
            Shape = Input { Value = FuID { "SurfaceCubeInputs" }, },
            MaterialInput = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            ["MtlStdInputs.MaterialID"] = Input { Value = 1, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1, },
            ["SurfaceCubeInputs.ObjectID.ObjectID"] = Input { Value = 2, }
         },
         ViewInfo = OperatorInfo { Pos = { 0, 49.5 } },
      },
      Duplicate3D1 = Duplicate3D {
         Inputs = {
            LastCopy = Input { Value = 10, },
            ["Translate.Z"] = Input { Value = 3.46, },
            SceneInput = Input {
               SourceOp = "Shape3D1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 110, 49.5 } },
      },
      SpotLight1 = LightSpot {
         Inputs = {
            ["Transform3DOp.Translate.X"] = Input { Value = -3.87597887603176, },
            ["Transform3DOp.Translate.Y"] = Input { Value = 2.62996519702911, },
            ["Transform3DOp.Translate.Z"] = Input { Value = -6.03148542031081, },
            ["Transform3DOp.Rotate.X"] = Input { Value = -12.2000064849854, },
            ["Transform3DOp.Rotate.Y"] = Input { Value = -158.399993896484, },
            Intensity = Input { Value = 1.436, },
            Dropoff = Input { Value = 8.31, },
         },
         ViewInfo = OperatorInfo { Pos = { 110, -16.5 } },
      },
      Merge3D1 = Merge3D {
         Inputs = {
            SceneInput1 = Input {
               SourceOp = "Duplicate3D1",
               Source = "Data3D",
            },
            SceneInput2 = Input {
               SourceOp = "Camera3D1",
               Source = "Output",
            },
            SceneInput3 = Input {
               SourceOp = "SpotLight1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 220, 49.5 } },
      },
      Camera3D1 = Camera3D {
         Inputs = {
            ["Transform3DOp.Translate.X"] = Input { Value = -3.44120868940328, },
            ["Transform3DOp.Translate.Y"] = Input { Value = 1.38276398913712, },
            ["Transform3DOp.Translate.Z"] = Input { Value = -4.93338161948502, },
            ["Transform3DOp.Rotate.X"] = Input { Value = -12.2000064849854, },
            ["Transform3DOp.Rotate.Y"] = Input { Value = -158.399993896484, },
            FLength = Input { Value = 18.2123442718302, },
            ["Stereo.Mode"] = Input { Value = FuID { "Mono" }, },
            FilmGate = Input { Value = FuID { "BMD_URSA_4K_16x9" }, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 3, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 2, },
         },
         ViewInfo = OperatorInfo { Pos = { 220, 115.5 } },
      },
      Renderer3D1 = Renderer3D {
         CustomData = {
            ToolVersion = 2,
         },
         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",
            },
            ["RendererSoftware.Channels.Nest"] = Input { Value = 1, },
            ["RendererSoftware.Channels.Z"] = Input { Value = 1, },
            ["RendererSoftware.LightingEnabled"] = Input { Value = 1, },
            ["RendererSoftware.ShadowsEnabled"] = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 330, 49.5 } },
      },
      DepthBlur1 = DepthBlur {
         CtrlWZoom = false,
         Inputs = {
            Filter = Input { Value = 2, },
            XBlurSize = Input { Value = 10, },
            FocalPoint = Input { Value = -5.36917400360107, },
            ZScale = Input { Value = 30, },
            Input = Input {
               SourceOp = "Renderer3D1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 495, 49.5 } },
      },
      ChannelBooleans1 = ChannelBoolean {
         Inputs = {
            ToRed = Input { Value = 4, },
            ToGreen = Input { Value = 4, },
            ToBlue = Input { Value = 4, },
            ToAlpha = Input { Value = 4, },
            EnableExtraChannels = Input { Value = 1, },
            ToXPosition = Input { Value = 5, },
            ToYPosition = Input { Value = 6, },
            ToZPosition = Input { Value = 7, },
            Background = Input {
               SourceOp = "Renderer3D1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 495, 115.5 } },
      }
   }
}
Offline

David_Cox

  • Posts: 108
  • Joined: Thu Aug 03, 2017 11:20 pm
  • Location: London UK

Re: Help me understand the Z depth and Depth blur

PostWed Aug 09, 2017 9:22 am

Hello,

You are pretty much there with your set up.

Don't be worried about the "white" Z channel. It's just that this channel is using linear numbers and so generates values that are "whiter than white" when viewed. The depth info is there.

To visually work with the Depth Blur, get its RGB output up on a viewer and click and hold the "pick" button found in its control panel. Now drag the mouse cursor, still pressed down, to the point in the viewer that you want to be in focus. Stop holding down the click to select.

Just as a double check, when you drag your mouse pointer over the image, you should see changing values for R,G,B,A and Z displayed. If you don't see Z, it's because the depth channel hasn't been enabled upstream. However, you have done this correctly in your example and the Z values are shown.

Hope that helps.

DC
Showreels: vimeo.com/davidcoxtv
Website: www.davidcox.tv

Return to Fusion

Who is online

Users browsing this forum: No registered users and 68 guests