Page 1 of 1

3D Text Remains Partially Transparent

PostPosted: Sat May 23, 2020 12:05 am
by dcolacino
I have created a 3D composite on Resolve Studio 16.2.2's Fusion page, where text appears in a street with people walking behind it. Everything is great except that I cannot seem to make the 3D text completely opaque, even though I have the material set to "solid" on the Text3D node's "shading" tab. How can I make the text appear solid, so that the scene behind it doesn't bleed through?

Re: 3D Text Remains Partially Transparent

PostPosted: Sat May 23, 2020 12:46 am
by xunile
It would help if you can post a screenshot of your Fusion tab with the MediaOut in the one viewer and your Merge3D in the other, with the Text3D node selected and shown in the Inspector.

Also, check if the Opacity or Alpha sliders are less than 1.0

Re: 3D Text Remains Partially Transparent

PostPosted: Sat May 23, 2020 9:13 pm
by dcolacino
Untitled.jpg
Screenshot showing translucent 3D text that I want to be opaque.
Untitled.jpg (1010.43 KiB) Viewed 234 times
Thanks for your reply. Please see attached screen capture showing that both Alpha and Opacity are set to 1.0. I've also included the node tree with notes about everything I understand about it. The reason that MediaIn1 goes to two Merge nodes is that I have a foreground tree that passes between the camera and the 3D text.

Re: 3D Text Remains Partially Transparent

PostPosted: Sun May 24, 2020 12:35 am
by xunile
I would next look at your ReplaceMaterial3D node and make sure you haven't modified the Blend on any of the Merge nodes.

Re: 3D Text Remains Partially Transparent

PostPosted: Sun May 24, 2020 12:51 am
by Bryan Ray
What is the Apply Mode of Merge4? It looks to me like it's set to Multiply. A reduced Blend control would not make the shadows behind the text become darker. If the Apply Mode is anything other than Normal, you won't generally get a completely opaque result.

Re: 3D Text Remains Partially Transparent

PostPosted: Tue May 26, 2020 10:50 pm
by dcolacino
xunile wrote:I would next look at your ReplaceMaterial3D node and make sure you haven't modified the Blend on any of the Merge nodes.


All 4 channels on Replacematerial3D are set to "Replace," and all Merge nodes have Blend set to 1.0.

As a debug step, I added another Text3D node behind the first one. In 3D space I can see that the Text3D node is opaque. In other words, the first line of text obscures the new line behind it. It is completely opaque to other 3D elements. However, as soon as I load Merge2 into the viewer, which merges in the video layer in 2D space, both Text3D elements are transparent to the background video - but not to each other.

Clues?

Re: 3D Text Remains Partially Transparent

PostPosted: Tue May 26, 2020 11:05 pm
by dcolacino
Bryan Ray wrote:What is the Apply Mode of Merge4? It looks to me like it's set to Multiply. A reduced Blend control would not make the shadows behind the text become darker. If the Apply Mode is anything other than Normal, you won't generally get a completely opaque result.


Merge4 is set to Normal but Merge2, where I first bring in the background video is indeed set to Multiply. If I set it to Normal then the shadow plane becomes visible. All I want to see is the shadows. Is there another way to do that?

Re: 3D Text Remains Partially Transparent

PostPosted: Wed May 27, 2020 12:44 am
by xunile
dcolacino wrote:
Bryan Ray wrote:What is the Apply Mode of Merge4? It looks to me like it's set to Multiply. A reduced Blend control would not make the shadows behind the text become darker. If the Apply Mode is anything other than Normal, you won't generally get a completely opaque result.


Merge4 is set to Normal but Merge2, where I first bring in the background video is indeed set to Multiply. If I set it to Normal then the shadow plane becomes visible. All I want to see is the shadows. Is there another way to do that?


Maybe try the solution this video presents. It is probably the Merge2 set to multiply creating the problem like Brian suggested.

Re: 3D Text Remains Partially Transparent

PostPosted: Wed May 27, 2020 2:23 am
by Bryan Ray
Yep, that's one way to do it. Or you can do some Override3D trickery to render the shadows separately, which might prevent you from getting halo problems, since the shadow caster won't be held out from the shadow itself:

Code: Select all
{
   Tools = ordered() {
      SpotLight1 = LightSpot {
         Inputs = {
            ["Transform3DOp.Translate.X"] = Input { Value = 0.297897595778111, },
            ["Transform3DOp.Translate.Y"] = Input { Value = 2.64706559871894, },
            ["Transform3DOp.Translate.Z"] = Input { Value = 3.54515937678411, },
            ["Transform3DOp.Rotate.X"] = Input { Value = -23.5, },
            ["Transform3DOp.Rotate.Y"] = Input { Value = 3.6, },
            ConeAngle = Input { Value = 86.61, },
            PenumbraAngle = Input { Value = 20, },
            ["ShadowLightInputs3D.Nest"] = Input { Value = 1, },
            ["ShadowLightInputs3D.ShadowDensity"] = Input { Value = 1, },
            ["ShadowLightInputs3D.ShadowMapSize"] = Input { Value = 5702, },
            ["ShadowLightInputs3D.FilterSize"] = Input { Value = 0.04, },
         },
         ViewInfo = OperatorInfo { Pos = { 330, 82.5 } },
      },
      Shape3D4 = Shape3D {
         Inputs = {
            ["Transform3DOp.Translate.Y"] = Input { Value = 0.684097788764113, },
            Shape = Input { Value = FuID { "SurfaceCylinderInputs" }, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 5, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 5, },
            ["SurfaceCylinderInputs.Radius"] = Input { Value = 0.28, },
            ["SurfaceCylinderInputs.ObjectID.Nest"] = Input { Value = 1, },
            ["SurfaceCylinderInputs.ObjectID.ObjectID"] = Input { Value = 6, }
         },
         ViewInfo = OperatorInfo { Pos = { 220, 115.5 } },
      },
      Merge3D3 = Merge3D {
         Inputs = {
            SceneInput1 = Input {
               SourceOp = "Shape3D3",
               Source = "Output",
            },
            SceneInput2 = Input {
               SourceOp = "Shape3D4",
               Source = "Output",
            },
            SceneInput3 = Input {
               SourceOp = "Camera3D1_6",
               Source = "Output",
            },
            SceneInput4 = Input {
               SourceOp = "SpotLight1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 330, 148.5 } },
      },
      Shape3D3 = Shape3D {
         Inputs = {
            ["Transform3DOp.Rotate.X"] = Input { Value = -90, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 4, },
            ["SurfacePlaneInputs.Width"] = Input { Value = 9.66, },
            ["SurfacePlaneInputs.Lighting.Nest"] = Input { Value = 1, },
            ["SurfacePlaneInputs.ObjectID.Nest"] = Input { Value = 1, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 4, }
         },
         ViewInfo = OperatorInfo { Pos = { 220, 148.5 } },
      },
      Override3D2 = Override3D {
         Inputs = {
            SceneInput = Input {
               SourceOp = "Merge3D3",
               Source = "Output",
            },
            ["Visibility.IsUnseenByCameras"] = Input { Value = 1, },
            ["Matte.DoMatte"] = Input { Value = 1, },
            ["Matte.IsMatte"] = Input { Value = 1, },
            ["Exclusions.LimitByObjectID"] = Input { Value = 1, },
            ["Exclusions.ObjectID"] = Input { Value = 4, },
         },
         ViewInfo = OperatorInfo { Pos = { 550, 148.5 } },
      },
      Renderer3D2 = Renderer3D {
         CustomData = {
            ToolVersion = 2,
         },
         Inputs = {
            GlobalIn = Input { Value = 1001, },
            GlobalOut = Input { Value = 1121, },
            Width = Input { Value = 1888, },
            Height = Input { Value = 796, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            SceneInput = Input {
               SourceOp = "Override3D2",
               Source = "Output",
            },
            ["RendererSoftware.LightingEnabled"] = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 660, 148.5 } },
      },
      Background5 = Background {
         Inputs = {
            GlobalIn = Input { Value = 1001, },
            GlobalOut = Input { Value = 1121, },
            Width = Input { Value = 1888, },
            Height = Input { Value = 796, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input { Value = 1, },
            TopLeftGreen = Input { Value = 1, },
            TopLeftBlue = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 660, 181.5 } },
      },
      ColorCorrector2 = ColorCorrector {
         Inputs = {
            MasterRGBGain = Input { Value = 0.308, },
            ColorRanges = Input {
               Value = ColorCurves {
                  Curves = {
                     {
                        Points = {
                           { 0, 1 },
                           { 0.4, 0.2 },
                           { 0.6, 0 },
                           { 1, 0 }
                        }
                     },
                     {
                        Points = {
                           { 0, 0 },
                           { 0.4, 0 },
                           { 0.6, 0.2 },
                           { 1, 1 }
                        }
                     }
                  }
               },
            },
            HistogramIgnoreTransparent = Input { Value = 1, },
            Input = Input {
               SourceOp = "Background5",
               Source = "Output",
            },
            EffectMask = Input {
               SourceOp = "Bitmap1",
               Source = "Mask",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 770, 181.5 } },
      },
      Camera3D1_6 = Camera3D {
         NameSet = true,
         CustomData = {
            Settings = {
               [1] = {
                  Tools = ordered() {
                     Camera3D1 = Camera3D {
                        Inputs = {
                           ApertureW = Input { Value = 0.831496062992126 },
                           AoV = Input { Value = 19.2642683071402 },
                           ["Stereo.Mode"] = Input { Value = FuID { "OffAxis" } },
                           ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1 },
                           ApertureH = Input { Value = 0.467716535433071 },
                           FilmGate = Input { Value = FuID { "BMD_URSA_4K_16x9" } },
                           ["MtlStdInputs.MaterialID"] = Input { Value = 1 }
                        },
                        Name = "Camera3D1",
                        CtrlWZoom = false,
                        NameSet = true,
                        ViewInfo = OperatorInfo { Pos = { 550, 214.5 } },
                        CustomData = {
                        }
                     }
                  }
               },
               [6] = {
                  Tools = ordered() {
                     Camera3D1 = Camera3D {
                        Inputs = {
                           FLength = Input { Value = 49.0568334445481 },
                           ["Transform3DOp.Translate.Z"] = Input { Expression = "self.ImageInput.Metadata.Translate.Z" },
                           ImagePlaneEnabled = Input { Value = 0 },
                           AoV = Input {
                              Value = 19.2642683071402,
                              Expression = "self.ImageInput.Metadata.RSCameraFOV or self.ImageInput.Metadata['rs/camera/fov']"
                           },
                           AovType = Input { Value = 1 },
                           ["Transform3DOp.Rotate.Y"] = Input { Expression = "self.ImageInput.Metadata.Rotate.Y" },
                           ApertureH = Input { Value = 0.9 },
                           FilmGate = Input { Value = FuID { "HD" } },
                           ["Transform3DOp.Rotate.X"] = Input { Expression = "self.ImageInput.Metadata.Rotate.X" },
                           ["Transform3DOp.Translate.X"] = Input { Expression = "self.ImageInput.Metadata.Translate.X" },
                           PlaneOfFocus = Input { Expression = "self.ImageInput.Metadata.RSCameraDOFFocusDistance or self.ImageInput.Metadata['rs/camera/DOFFocusDistance']" },
                           FilmBack = Input { Value = 1 },
                           ["Transform3DOp.Rotate.RotOrder"] = Input { Value = FuID { "ZXY" } },
                           ["MtlStdInputs.MaterialID"] = Input { Value = 1 },
                           ["Stereo.Mode"] = Input { Value = FuID { "OffAxis" } },
                           ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1 },
                           ["Transform3DOp.Translate.Y"] = Input { Expression = "self.ImageInput.Metadata.Translate.Y" },
                           ApertureW = Input { Value = 1.6 },
                           ["Transform3DOp.Rotate.Z"] = Input { Expression = "self.ImageInput.Metadata.Rotate.Z" }
                        },
                        CtrlWZoom = false,
                        NameSet = true,
                        ViewInfo = OperatorInfo { Pos = { 387, 145 } },
                        CustomData = {
                        }
                     }
                  }
               }
            }
         },
         Inputs = {
            ["Transform3DOp.Translate.X"] = Input { Value = 3.88604318851831, },
            ["Transform3DOp.Translate.Y"] = Input { Value = 3.0828491629418, },
            ["Transform3DOp.Translate.Z"] = Input { Value = 3.47448115679429, },
            ["Transform3DOp.Rotate.X"] = Input { Value = -30.6000328063965, },
            ["Transform3DOp.Rotate.Y"] = Input { Value = -311.799652099609, },
            FLength = Input { Value = 18.2123442718302, },
            ["Stereo.Mode"] = Input { Value = FuID { "OffAxis" }, },
            FilmGate = Input { Value = FuID { "BMD_URSA_4K_16x9" }, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 330, 214.5 } },
      },
      Bitmap1 = BitmapMask {
         Inputs = {
            Invert = Input { Value = 1, },
            MaskWidth = Input { Value = 1888, },
            MaskHeight = Input { Value = 796, },
            PixelAspect = Input { Value = { 1, 1 }, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Image = Input {
               SourceOp = "Renderer3D2_1",
               Source = "Output",
            },
            Channel = Input { Value = FuID { "Luminance" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 770, 214.5 } },
      },
      Renderer3D2_1 = Renderer3D {
         CustomData = {
            ToolVersion = 2,
         },
         Inputs = {
            GlobalIn = Input { Value = 1001, },
            GlobalOut = Input { Value = 1121, },
            Width = Input { Value = 1888, },
            Height = Input { Value = 796, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            SceneInput = Input {
               SourceOp = "Override3D1",
               Source = "Output",
            },
            ["RendererSoftware.LightingEnabled"] = Input { Value = 1, },
            ["RendererSoftware.ShadowsEnabled"] = Input { Value = 1, },
            ["RendererOpenGL.LightingEnabled"] = Input { Value = 1, },
            ["RendererOpenGL.ShadowsEnabled"] = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 660, 214.5 } },
      },
      Override3D1 = Override3D {
         Inputs = {
            SceneInput = Input {
               SourceOp = "Merge3D3",
               Source = "Output",
            },
            ["Visibility.DoIsUnseenByCameras"] = Input { Value = 1, },
            ["Visibility.IsUnseenByCameras"] = Input { Value = 1, },
            ["Lighting.IsAffectedByLights"] = Input { Value = 0, },
            ["Exclusions.LimitByObjectID"] = Input { Value = 1, },
            ["Exclusions.ObjectID"] = Input { Value = 6, },
         },
         ViewInfo = OperatorInfo { Pos = { 550, 214.5 } },
      },
      Merge19 = Merge {
         Inputs = {
            Background = Input {
               SourceOp = "ColorCorrector2",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Renderer3D2",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 880, 181.5 } },
      }
   }
}

Re: 3D Text Remains Partially Transparent

PostPosted: Wed May 27, 2020 8:34 pm
by dcolacino
The method in the video looks elegant, except that the shadow plane remains visible when composited over a video image. I ended up doing something similar based on viewtopic.php?f=22&t=56315, with an extra step of compositing a tree in the foreground to pass in front of the 3D text. (The foreground tree does not appear in this frame.)

The only problem with this is that I can't control the darkness of the shadow on the ground, so if you look between the "d" and the "T" in the attached image, you'll see the pedestrians are casting a shadow on top of the composited shadow. Adding a ColorCorrector node after Merge5 lets me darken the shadows from the 3D text, but it makes the overlapped shadow darker as well.

I'm also puzzled by the jagged edges on the shadows. Any idea what's causing that?

Re: 3D Text Remains Partially Transparent

PostPosted: Thu May 28, 2020 1:50 am
by Bryan Ray
The jagged edges are probably because your shadow map doesn't have enough resolution. You can increase it in the spotlight controls. Spin down the Shadow control and turn up Shadow Map Size.

Instead of color correcting, try making a Background and sampling the color of the existing shadows in the plate. Put your extracted shadow into the Effect Mask input of the Background, and then Merge it over the plate using the Darken Apply Mode.That will ensure that the shadows combine properly instead of multiplying one another.

I see you've also got a bit of an edge problem between the shadows and the text. If you put an ErodeDilate tool on the shadow mask, and then dilate it slightly to cover the gap, that should go away.

Re: 3D Text Remains Partially Transparent

PostPosted: Sat May 30, 2020 8:57 pm
by dcolacino
Thank you Bryan! That worked really well!

When routing the 2D shadow into the background node I already have (WhiteBackground), the color makes no difference. Is that what you meant? "Darken" mode on the Merge2 made the most difference. To match the shadow color I tried changing "Shadow Color" in the Spotlight node but it had no effect. Instead, I adjusted the "Transmittance" color on the ReplaceMaterial3D node and achieved a pretty-much-perfect match.

ErodeDilate is sweet!