Jump to: Board index » General » Fusion

How does refraction work?

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

Igor Riđanović

  • Posts: 1596
  • Joined: Thu Jul 02, 2015 5:11 am
  • Location: Los Angeles, Calif.

How does refraction work?

PostSat May 30, 2020 8:33 pm

I'm trying to wrap my head around what and how the refraction in Reflect tool is supposed to do. I get there is no ray tracing going on and that Reflect tool is unaware of the actual geometry in the scene. Yet I would expect to see some simulated displacement when the refraction is enabled.

Instead when I connect a sphere map to Reflect.Refraction.Tint.Material and set the transparency lower than 1.0 in the material shader, the rendered object ceases to be transparent at all. I do see some additional reflection-like swirling on the object surface, but I can't see through the object.

Here's what I'm talking about.

Code: Select all
{
   Tools = ordered() {
      RFLX_Map = GroupOperator {
         NameSet = true,
         Outputs = {
            Output1 = InstanceOutput {
               SourceOp = "Paint1",
               Source = "Output",
            }
         },
         ViewInfo = GroupInfo {
            Pos = { -158.333, -18.3329 },
            Flags = {
               AllowPan = false,
               AutoSnap = true,
               RemoveRouters = true
            },
            Size = { 236, 66.3636, 118, 24.2424 },
            Direction = "Horizontal",
            PipeStyle = "Direct",
            Scale = 1,
            Offset = { 158.333, 18.3329 }
         },
         Tools = ordered() {
            Paint1 = Paint {
               Inputs = {
                  Input = Input {
                     SourceOp = "Background1",
                     Source = "Output",
                  },
                  Paint = Input {
                     SourceOp = "Rectangle6",
                     Source = "Out",
                  },
               },
               ViewInfo = OperatorInfo { Pos = { -103.333, -9.69655 } },
            },
            Background1 = Background {
               Inputs = {
                  GlobalOut = Input { Value = 119, },
                  Width = Input { Value = 300, },
                  Height = Input { Value = 150, },
                  ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
               },
               ViewInfo = OperatorInfo { Pos = { -213.333, -9.69655 } },
            }
         },
      },
      Rectangle6 = Rectangle {
         IsThreaded = false,
         Brushes = {
         },
         ApplyModes = { "PaintApplyColor" },
         CtrlWZoom = false,
         Inputs = {
            Paint = Input {
               SourceOp = "Rectangle5",
               Source = "Out",
            },
            ["PaintApplyColor.Red"] = Input { Value = 0, },
            ["PaintApplyColor.Green"] = Input { Value = 0, },
            ["PaintApplyColor.Blue"] = Input { Value = 0, },
         },
      },
      Rectangle5 = Rectangle {
         IsThreaded = false,
         Brushes = {
         },
         ApplyModes = { "PaintApplyColor" },
         CtrlWZoom = false,
         Inputs = {
            Center = Input { Value = { 0.551666652783751, 0.836666643619537 }, },
            Paint = Input {
               SourceOp = "Rectangle4",
               Source = "Out",
            },
            Width = Input { Value = 1.20333330705762, },
            Height = Input { Value = 0.126666665077209, },
            ["PaintApplyColor.Red"] = Input { Value = 0, },
            ["PaintApplyColor.Green"] = Input { Value = 0, },
            ["PaintApplyColor.Blue"] = Input { Value = 0, },
         },
      },
      Rectangle4 = Rectangle {
         IsThreaded = false,
         Brushes = {
         },
         ApplyModes = { "PaintApplyColor" },
         CtrlWZoom = false,
         Inputs = {
            Center = Input { Value = { 0.484999991953373, 0.0833333320915699 }, },
            Paint = Input {
               SourceOp = "Rectangle3",
               Source = "Out",
            },
            Width = Input { Value = 1.06333331763744, },
            Height = Input { Value = 0.00666666775941849, },
            ["PaintApplyColor.Red"] = Input { Value = 0.89, },
            ["PaintApplyColor.Green"] = Input { Value = 0.89, },
            ["PaintApplyColor.Blue"] = Input { Value = 0.89, },
         },
      },
      Rectangle3 = Rectangle {
         IsThreaded = false,
         Brushes = {
         },
         ApplyModes = { "PaintApplyColor" },
         CtrlWZoom = false,
         Inputs = {
            Center = Input { Value = { 0.491666660644114, 0.20666666328907 }, },
            Paint = Input {
               SourceOp = "Rectangle2",
               Source = "Out",
            },
            Width = Input { Value = 1.04333331994712, },
            Height = Input { Value = 0.026666671037674, },
            ["PaintApplyColor.Red"] = Input { Value = 0.89, },
            ["PaintApplyColor.Green"] = Input { Value = 0.89, },
            ["PaintApplyColor.Blue"] = Input { Value = 0.89, },
         },
      },
      Rectangle2 = Rectangle {
         IsThreaded = false,
         Brushes = {
         },
         ApplyModes = { "PaintApplyColor" },
         CtrlWZoom = false,
         Inputs = {
            Center = Input { Value = { 0.473333306610584, 0.381578952074051 }, },
            Paint = Input {
               SourceOp = "Rectangle1",
               Source = "Out",
            },
            Width = Input { Value = 1.42666660249233, },
            Height = Input { Value = 0.0789473652839661, },
            ["PaintApplyColor.Red"] = Input { Value = 0.89, },
            ["PaintApplyColor.Green"] = Input { Value = 0.89, },
            ["PaintApplyColor.Blue"] = Input { Value = 0.89, },
         },
      },
      Rectangle1 = Rectangle {
         IsThreaded = false,
         Brushes = {
         },
         ApplyModes = { "PaintApplyColor" },
         CtrlWZoom = false,
         Inputs = {
            Center = Input { Value = { 0.206666648387909, 1.15789476037025 }, },
            Width = Input { Value = 2.38666665554047, },
            Height = Input { Value = 1.10526317358017, },
            ["PaintApplyColor.Red"] = Input { Value = 0.89, },
            ["PaintApplyColor.Green"] = Input { Value = 0.89, },
            ["PaintApplyColor.Blue"] = Input { Value = 0.89, },
         },
      },
      Phong1 = MtlPhong {
         CtrlWZoom = false,
         Inputs = {
            ["Diffuse.Color.Red"] = Input { Value = 0.685, },
            ["Diffuse.Color.Green"] = Input { Value = 0.15344, },
            ["Diffuse.Color.Blue"] = Input { Value = 0.15344, },
            ["Diffuse.Opacity"] = Input { Value = 0.803, },
            ["Specular.Nest"] = Input { Value = 1, },
            ["Specular.Color.Red"] = Input { Value = 0.898, },
            ["Specular.Color.Green"] = Input { Value = 0.868366, },
            ["Specular.Color.Blue"] = Input { Value = 0.868366, },
            ["Specular.Intensity"] = Input { Value = 0.52, },
            ["Specular.Exponent"] = Input { Value = 51.2, },
            MaterialID = Input { Value = 5, },
         },
         ViewInfo = OperatorInfo { Pos = { 39.9999, -78.7879 } },
      },
      SphereMap1 = SphereMap {
         Inputs = {
            Rotation = Input { Value = 1, },
            ["FilterMode.Nest"] = Input { Value = 1, },
            Image = Input {
               SourceOp = "Paint1",
               Source = "Output",
            },
            MaterialID = Input { Value = 4, },
         },
         ViewInfo = OperatorInfo { Pos = { 38.6667, 0.606036 } },
      },
      Reflect1 = MtlReflect {
         Inputs = {
            BackgroundMaterial = Input {
               SourceOp = "Phong1",
               Source = "MaterialOutput",
            },
            ["Reflection.GlancingStrength"] = Input { Value = 0.173, },
            ["Reflection.FaceOnStrength"] = Input { Value = 0.047, },
            ["Reflection.Falloff"] = Input { Value = 2.142, },
            ["Reflection.Color.Material"] = Input {
               SourceOp = "SphereMap1",
               Source = "MaterialOutput",
            },
            ["Refraction.RefractiveIndex.RGB"] = Input { Value = 0.8207, },
            ["Refraction.Tint.Red"] = Input { Value = 0.992, },
            ["Refraction.Tint.Green"] = Input { Value = 0.992, },
            ["Refraction.Tint.Blue"] = Input { Value = 0.992, },
            ["Refraction.Tint.Material"] = Input {
               SourceOp = "SphereMap1_1",
               Source = "MaterialOutput",
            },
            MaterialID = Input { Value = 2, },
         },
         ViewInfo = OperatorInfo { Pos = { 195.334, -15.7576 } },
      },
      AmbientLight1 = LightAmbient {
         Inputs = {
            ["Transform3DOp.Translate.Y"] = Input { Value = 4.44575746011912, },
            Intensity = Input { Value = 0.425, },
         },
         ViewInfo = OperatorInfo { Pos = { 445, -49.0152 } },
      },
      Torus = Shape3D {
         NameSet = true,
         Inputs = {
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 4, },
            ["Transform3DOp.Rotate.X"] = Input { Value = -41.7, },
            ["Transform3DOp.Scale.X"] = Input { Value = 10, },
            Shape = Input { Value = FuID { "SurfaceTorusInputs" }, },
            MaterialInput = Input {
               SourceOp = "Reflect1",
               Source = "MaterialOutput",
            },
            ["MtlStdInputs.MaterialID"] = Input { Value = 9, },
            ["SurfaceTorusInputs.Radius"] = Input { Value = 1.417, },
            ["SurfaceTorusInputs.SubdivisionLevelBase"] = Input { Value = 53, },
            ["SurfaceTorusInputs.SubdivisionLevelHeight"] = Input { Value = 47, },
            ["SurfaceTorusInputs.ObjectID.ObjectID"] = Input { Value = 5, }
         },
         ViewInfo = OperatorInfo { Pos = { 358.667, -10.9091 } },
      },
      DirectionalLight1 = LightDirectional {
         Inputs = {
            ["Transform3DOp.Rotate.Y"] = Input { Value = 101.7, },
            ["Transform3DOp.Rotate.Z"] = Input { Value = 47, },
            Intensity = Input { Value = 0.992, },
         },
         ViewInfo = OperatorInfo { Pos = { 525.667, -80.8031 } },
      },
      Merge3D1 = Merge3D {
         Inputs = {
            ["Transform3DOp.Translate.Y"] = Input { Value = 2.135, },
            ["Transform3DOp.Translate.Z"] = Input { Value = -6.23, },
            ["Transform3DOp.Rotate.Y"] = Input { Value = -44.3, },
            ["Transform3DOp.Scale.X"] = Input { Value = 0.1, },
            SceneInput3 = Input {
               SourceOp = "cam1",
               Source = "Output",
            },
            SceneInput6 = Input {
               SourceOp = "Torus",
               Source = "Output",
            },
            SceneInput5 = Input {
               SourceOp = "DirectionalLight1",
               Source = "Output",
            },
            SceneInput4 = Input {
               SourceOp = "AmbientLight1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 528.333, 17.7121 } },
      },
      Renderer3D1 = Renderer3D {
         CustomData = { ToolVersion = 2, },
         Inputs = {
            ["RendererSoftware.ShadowsEnabled"] = Input { Value = 1, },
            ["RendererOpenGLUV.LightingEnabled"] = Input { Value = 1, },
            ["RendererSoftware.LightingEnabled"] = Input { Value = 1, },
            ["RendererOpenGLUV.ShadowsEnabled"] = Input { Value = 1, },
            GlobalOut = Input { Value = 119, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            UseFrameFormatSettings = Input { Value = 1, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            SceneInput = Input {
               SourceOp = "Merge3D1",
               Source = "Output",
            },
            CameraSelector = Input { Value = FuID { "cam1" }, },
            RendererType = Input { Value = FuID { "RendererOpenGL" }, },
            ["RendererOpenGL.AntiAliasing.Nest"] = Input { Value = 1, },
            ["RendererOpenGL.AntiAliasing.Channels.RGBA.HighQuality.Enable"] = Input { Value = 1, },
            ["RendererOpenGL.AntiAliasing.Presets.Color.Supersampling.HighQuality.RateX"] = Input { Value = 3, },
            ["RendererOpenGL.AntiAliasing.Presets.Color.Supersampling.HighQuality.RateY"] = Input { Value = 3, },
            ["RendererOpenGL.AntiAliasing.Presets.Color.Multisampling.LowQuality.SampleCount"] = Input { Value = 2, },
            ["RendererOpenGL.AntiAliasing.Presets.Color.Multisampling.HighQuality.SampleCount"] = Input { Value = 3, },
            ["RendererOpenGL.AntiAliasing.Presets.Aux.Supersampling.HighQuality.RateX"] = Input { Value = 3, },
            ["RendererOpenGL.AntiAliasing.Presets.Aux.Supersampling.HighQuality.RateY"] = Input { Value = 3, },
            ["RendererOpenGL.AntiAliasing.Presets.Aux.Multisampling.LowQuality.SampleCount"] = Input { Value = 2, },
            ["RendererOpenGL.AntiAliasing.Presets.Aux.Multisampling.HighQuality.SampleCount"] = Input { Value = 3, },
            ["RendererOpenGL.AccumQuality"] = Input { Value = 32, },
            ["RendererOpenGL.LightingEnabled"] = Input { Value = 1, },
            ["RendererOpenGL.ShadowsEnabled"] = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 638.333, 17.7121 } },
         SubInputsData = {
            RendererOpenGL = {
               Version = 1
            }
         }
      },
      cam1 = Camera3D {
         NameSet = true,
         Inputs = {
            ["Transform3DOp.Translate.Y"] = Input { Value = 40.6390352601109, },
            ["Transform3DOp.Translate.Z"] = Input { Value = 118.921456854067, },
            ["Transform3DOp.Rotate.X"] = Input { Value = -20.9, },
            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 = 6, },
         },
         ViewInfo = OperatorInfo { Pos = { 719.667, -62.9545 } },
      },
      MediaOut1 = MediaOut {
         Inputs = {
            Index = Input { Value = "0", },
            Input = Input {
               SourceOp = "Renderer3D1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 748.333, 39.803 } },
      },
      SphereMap1_1 = SphereMap {
         Inputs = {
            Rotation = Input { Value = 1, },
            ["FilterMode.Nest"] = Input { Value = 1, },
            Image = Input {
               SourceOp = "ColorCorrector1",
               Source = "Output",
            },
            MaterialID = Input { Value = 4, },
         },
         ViewInfo = OperatorInfo { Pos = { 23.3333, 100.606 } },
      },
      ColorCorrector1 = ColorCorrector {
         Inputs = {
            WheelTintAngle1 = Input { Value = 0.398238572566757, },
            WheelTintLength1 = Input { Value = 0.5506, },
            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 = "Paint1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { -122, 101.212 } },
      }
   }
}
www.metafide.com - DaVinci Resolve™ Apps
Offline
User avatar

Bryan Ray

  • Posts: 2491
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: How does refraction work?

PostSat May 30, 2020 10:23 pm

Like the reflection, geo in Fusion will refract only an environment map. The color derived from the refraction tint material will override the sorted transparency that occurs when the Reflect node is bypassed.

You can do the same thing with refractions as you can with reflections, though: Use the Spherical Camera to photograph the scene without your refractive object, and feed that image into the SphereMap to become the environment map. I'm not sure what the deal is with the orientation. I had to rotate it -90 degrees in Y to get something that looked right, but here's an example:

Code: Select all
{
   Tools = ordered() {
      Checker = GroupOperator {
         NameSet = true,
         Inputs = ordered() {
            Input1 = InstanceInput {
               SourceOp = "CheckerBG",
               Source = "GlobalIn",
               ControlGroup = 1,
               Default = 0,
            },
            Input2 = InstanceInput {
               SourceOp = "CheckerBG",
               Source = "GlobalOut",
               ControlGroup = 1,
               Default = 300,
            },
            Input11 = InstanceInput {
               SourceOp = "CheckerDummyBG",
               Source = "UseFrameFormatSettings",
               Default = 0,
            },
            Input12 = InstanceInput {
               SourceOp = "CheckerDummyBG",
               Source = "Width",
               Default = 720,
            },
            Input13 = InstanceInput {
               SourceOp = "CheckerDummyBG",
               Source = "Height",
               Default = 486,
            },
            Input14 = InstanceInput {
               SourceOp = "CheckerRsz",
               Source = "PixelAspect",
               DefaultX = 1,
               DefaultY = 1,
            },
            Input3 = InstanceInput {
               SourceOp = "CheckerBG",
               Source = "TopLeftRed",
               Name = "Color1",
               ControlGroup = 2,
               Default = 0,
            },
            Input4 = InstanceInput {
               SourceOp = "CheckerBG",
               Source = "TopLeftGreen",
               Name = "Color1 Green",
               ControlGroup = 2,
               Default = 0,
            },
            Input5 = InstanceInput {
               SourceOp = "CheckerBG",
               Source = "TopLeftBlue",
               Name = "Color1 Blue",
               ControlGroup = 2,
               Default = 0,
            },
            Input6 = InstanceInput {
               SourceOp = "CheckerBG",
               Source = "TopLeftAlpha",
               Name = "Color1 Alpha",
               ControlGroup = 2,
               Default = 1,
            },
            Input7 = InstanceInput {
               SourceOp = "CheckerBG",
               Source = "TopRightRed",
               Name = "Color2",
               ControlGroup = 3,
               Default = 1,
            },
            Input8 = InstanceInput {
               SourceOp = "CheckerBG",
               Source = "TopRightGreen",
               Name = "Color2 Green",
               ControlGroup = 3,
               Default = 1,
            },
            Input9 = InstanceInput {
               SourceOp = "CheckerBG",
               Source = "TopRightBlue",
               Name = "Color2 Blue",
               ControlGroup = 3,
               Default = 1,
            },
            Input10 = InstanceInput {
               SourceOp = "CheckerBG",
               Source = "TopRightAlpha",
               Name = "Color2 Alpha",
               ControlGroup = 3,
               Default = 1,
            },
            Input15 = InstanceInput {
               SourceOp = "CheckerXf",
               Source = "FlipHoriz",
               Name = "Flip Horizontally",
               Default = 0,
            },
            Input16 = InstanceInput {
               SourceOp = "CheckerXf",
               Source = "FlipVert",
               Name = "Flip Vertically",
               Default = 0,
            },
            Input17 = InstanceInput {
               SourceOp = "CheckerXf",
               Source = "Center",
            },
            Input18 = InstanceInput {
               SourceOp = "CheckerXf",
               Source = "Size",
               Default = 0.5,
            },
            Input19 = InstanceInput {
               SourceOp = "CheckerXf",
               Source = "Aspect",
               Default = 1,
            },
            Input20 = InstanceInput {
               SourceOp = "CheckerXf",
               Source = "Angle",
               Default = 0,
            }
         },
         Outputs = {
            MainOutput1 = InstanceOutput {
               SourceOp = "CheckerCrp",
               Source = "Output",
            }
         },
         ViewInfo = GroupInfo {
            Pos = { 725, 153 },
            Flags = {
               AllowPan = false,
               AutoSnap = true,
               RemoveRouters = true
            },
            Size = { 456, 97.3, 228, 22 },
            Direction = "Horizontal",
            PipeStyle = "Direct",
            Scale = 1,
            Offset = { 0, 0 }
         },
         Tools = ordered() {
            CheckerBG = Background {
               NameSet = true,
               Inputs = {
                  Width = Input { Value = 2, },
                  Height = Input { Value = 2, },
                  Type = Input { Value = FuID { "Corner" }, },
                  TopRightRed = Input { Value = 1, },
                  TopRightGreen = Input { Value = 1, },
                  TopRightBlue = Input { Value = 1, },
                  BottomLeftRed = Input { Value = 1, },
                  BottomLeftGreen = Input { Value = 1, },
                  BottomLeftBlue = Input { Value = 1, },
                  BottomLeftAlpha = Input { Value = 0.7843137383461, },
                  BottomRightRed = Input { Value = 0.294117659330368, },
                  BottomRightGreen = Input { Value = 0.062745101749897, },
                  BottomRightBlue = Input { Value = 0.10196078568697, },
                  BottomRightAlpha = Input { Value = 0.7843137383461, },
                  FrameRenderScript = Input { Value = "BottomLeftRed = TopRightRed\r\nBottomLeftGreen = TopRightGreen\r\nBottomLeftBlue = TopRightBlue\r\nBottomLeftAlpha = TopRightAlpha\r\nBottomRightRed = TopLeftRed\r\nBottomRightGreen = TopLeftGreen\r\nBottomRightBlue = TopLeftBlue\r\nBottomRightAlpha = TopLeftAlpha\r\n", },
                  Comments = Input { Value = "Creates a 2x2 checker pattern", },
                  EffectMask = Input {
                     SourceOp = "CheckerDummyBG",
                     Source = "Output",
                  }
               },
               ViewInfo = OperatorInfo { Pos = { -165, 43.15 } },
            },
            CheckerCrp = Crop {
               CtrlWShown = false,
               NameSet = true,
               Inputs = {
                  XSize = Input { Value = 1, },
                  YSize = Input { Value = 1, },
                  KeepCentered = Input { Value = 1, },
                  Input = Input {
                     SourceOp = "CheckerXf",
                     Source = "Output",
                  },
                  FrameRenderScript = Input { Value = "XSize = CheckerDummyBG.Width\r\nYSize = CheckerDummyBG.Height\r\n", },
                  Comments = Input { Value = "Crops to final size (from CheckerDummyBG)", }
               },
               ViewInfo = OperatorInfo { Pos = { 165, 43.15 } },
            },
            CheckerDummyBG = Background {
               NameSet = true,
               Inputs = {
                  Width = Input { Value = 512, },
                  Height = Input { Value = 512, },
                  Comments = Input { Value = "This is used only as a source for Width/Height controls. It is connected to the source BG in order to force re-renders when the dimensions change, but disabled to prevent any masking from occurring.", },
               },
               ViewInfo = OperatorInfo { Pos = { -165, 10.15 } },
            },
            CheckerRsz = BetterResize {
               CtrlWShown = false,
               NameSet = true,
               Inputs = {
                  Width = Input { Value = 700, },
                  Height = Input { Value = 200, },
                  ChangePixelAspect = Input { Value = 1, },
                  PixelAspect = Input { Value = { 1, 1 }, },
                  FilterMethod = Input { Value = 0, },
                  Input = Input {
                     SourceOp = "CheckerBG",
                     Source = "Output",
                  },
                  FrameRenderScript = Input { Value = "Width = math.max(CheckerDummyBG.Width, CheckerDummyBG.Height)\r\nHeight = math.max(CheckerDummyBG.Width, CheckerDummyBG.Height)\r\n", },
                  Comments = Input { Value = "Resize up the Checker pattern (with Nearest Neighbour)", }
               },
               ViewInfo = OperatorInfo { Pos = { -55, 43.15 } },
            },
            CheckerXf = Transform {
               CtrlWZoom = false,
               CtrlWShown = false,
               NameSet = true,
               Inputs = {
                  Size = Input { Value = 0.256, },
                  Edges = Input { Value = 1, },
                  Input = Input {
                     SourceOp = "CheckerRsz",
                     Source = "Output",
                  },
                  Comments = Input { Value = "All transformations done here", },
               },
               ViewInfo = OperatorInfo { Pos = { 55, 43.15 } },
            }
         },
      },
      Shape3D1_1 = Shape3D {
         Inputs = {
            ["Transform3DOp.Translate.Z"] = Input { Value = -3.43815056093121, },
            MaterialInput = Input {
               SourceOp = "CheckerCrp",
               Source = "Output",
            },
            ["MtlStdInputs.MaterialID"] = Input { Value = 1, },
            ["SurfaceSphereInputs.ObjectID.ObjectID"] = Input { Value = 2, },
            ["SurfacePlaneInputs.Width"] = Input { Value = 4.7, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1, }
         },
         ViewInfo = OperatorInfo { Pos = { 729, 229 } },
      },
      Blinn1 = MtlBlinn {
         Inputs = {
            ["Diffuse.Opacity"] = Input { Value = 0, },
            ["Transmittance.Nest"] = Input { Value = 1, },
            ["Transmittance.Color.Red"] = Input { Value = 1, },
            ["Transmittance.Color.Green"] = Input { Value = 1, },
            ["Transmittance.Color.Blue"] = Input { Value = 1, },
            MaterialID = Input { Value = 2, },
         },
         ViewInfo = OperatorInfo { Pos = { 1200, 240 } },
      },
      Camera3D1 = 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 = 2.62543735596545, },
            ["Transform3DOp.Translate.Y"] = Input { Value = 1.0070564550669, },
            ["Transform3DOp.Translate.Z"] = Input { Value = 4.04281840986142, },
            ["Transform3DOp.Rotate.X"] = Input { Value = -10.9999973297119, },
            ["Transform3DOp.Rotate.Y"] = Input { Value = 33.2000038146973, },
            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 = { 1307, 76 } },
      },
      Merge3D2 = Merge3D {
         Inputs = {
            SceneInput1 = Input {
               SourceOp = "Shape3D1_1",
               Source = "Output",
            },
            SceneInput2 = Input {
               SourceOp = "Camera3D1",
               Source = "Output",
            },
            SceneInput3 = Input {
               SourceOp = "Shape3D1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1349, 192 } },
      },
      SphericalCamera1 = SphericalCamera3D {
         Inputs = {
            ["Stereo.Mode"] = Input { Value = FuID { "OffAxis" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 617, 301 } },
      },
      Reflect1 = MtlReflect {
         Inputs = {
            BackgroundMaterial = Input {
               SourceOp = "Blinn1",
               Source = "MaterialOutput",
            },
            ["Reflection.GlancingStrength"] = Input { Value = 0, },
            ["Refraction.RefractiveIndex.SeparateRGBIndices"] = Input { Value = 1, },
            ["Refraction.Tint.Material"] = Input {
               SourceOp = "SphereMap1",
               Source = "MaterialOutput",
            },
            MaterialID = Input { Value = 4, },
         },
         ViewInfo = OperatorInfo { Pos = { 1204, 302 } },
      },
      Merge3D1 = Merge3D {
         Inputs = {
            SceneInput2 = Input {
               SourceOp = "Shape3D1_1",
               Source = "Output",
            },
            SceneInput3 = Input {
               SourceOp = "SphericalCamera1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 752, 304 } },
      },
      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",
            },
            CameraSelector = Input { Value = FuID { "SphericalCamera1" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 912, 304 } },
      },
      SphereMap1 = SphereMap {
         Inputs = {
            Rotation = Input { Value = 1, },
            ["Rotate.Y"] = Input { Value = -90, },
            Image = Input {
               SourceOp = "Renderer3D1",
               Source = "Output",
            },
            MaterialID = Input { Value = 3, },
         },
         ViewInfo = OperatorInfo { Pos = { 1078, 304 } },
      },
      Shape3D1 = Shape3D {
         Inputs = {
            Shape = Input { Value = FuID { "SurfaceSphereInputs" }, },
            MaterialInput = Input {
               SourceOp = "Reflect1",
               Source = "MaterialOutput",
            },
            ["MtlStdInputs.MaterialID"] = Input { Value = 1, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1, },
            ["SurfaceSphereInputs.ObjectID.ObjectID"] = Input { Value = 2, },
            ["SurfaceCubeInputs.ObjectID.ObjectID"] = Input { Value = 3, }
         },
         ViewInfo = OperatorInfo { Pos = { 1325, 304 } },
      },
      Renderer3D2 = Renderer3D {
         CustomData = {
            ToolVersion = 2,
         },
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            SceneInput = Input {
               SourceOp = "Merge3D2",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1512, 190 } },
      }
   }
}
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline
User avatar

Igor Riđanović

  • Posts: 1596
  • Joined: Thu Jul 02, 2015 5:11 am
  • Location: Los Angeles, Calif.

Re: How does refraction work?

PostSun May 31, 2020 6:34 am

Thanks, that's a great example how it works, and the spherical cam is a good trick. I'm still confused though why when the map is connected to the refraction color input the object is no longer transparent.

For example, if you use a cube or a torus and rotate them you can only see the polygons facing the camera. If refraction index is 1.0, shouldn't you be able to see the objects hidden faces and edges?
www.metafide.com - DaVinci Resolve™ Apps
Offline
User avatar

Bryan Ray

  • Posts: 2491
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: How does refraction work?

PostSun May 31, 2020 2:30 pm

You could if there were a real ray involved, but it's a hack of refraction, not actual refraction. It's again just like the reflection problem. A reflective object cannot reflect pieces of itself. And an object with refractions still can't display its own occluded surfaces.
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com

Return to Fusion

Who is online

Users browsing this forum: No registered users and 22 guests