Advanced Screen Replacement in DaVinci Resolve Fusion with Mocha

Follow along with this tutorial using the footage included as part of joining the Cutting Club here. This is the best way you can currently support my teaching efforts.


Welcome to the definitive workflow for creating flawless screen replacements and inserts on the DaVinci Resolve Fusion page. Whether you consider yourself a beginner or a seasoned compositing pro, this guide will walk you through a professional template using Mocha Pro. We will cover everything from handling S-Log3 color management to using Alpha Gain for lighting integration, Variblur for depth of field, and stabilized rotoscoping for complex occlusions.

Linear Color Space Management

Before doing any compositing, it is critical to manage your color space properly.

  • Assess your footage: In this example, the source footage is S-Log3, S-Gamut3.Cine with a heavy screen reflection.

  • Convert to Linear: You never want to composite directly with log footage. Start by adding a Color Space Transform (CST) node to convert the footage into Linear space. Ensure there is no tone mapping applied during this step.

  • Create a Rec.709 branch: Create a separate branched node with a second CST to convert the footage to Rec.709 with tone mapping enabled. This Rec.709 version is strictly for feeding optimal, high-contrast data into tracking software like Mocha Pro or Resolve's Magic Mask.

Tracking with Mocha Pro

When shooting practical footage for a screen replacement, it is always best to turn the device screen off and remove all tracking markers so you don't have to paint them out later.

  • Track occlusions first: Always track objects blocking the screen (like a finger or corner occlusion) before tracking the screen itself. Use the X-spline tool to draw a shape over any coplanar area of the occluding object.

  • Extend your shapes: You can extend the shape's edges to ensure it completely covers the intersection of the object and the screen.

  • Track the bezels: When tracking the screen, target the outer bezels rather than the center of the display. Reflections and changing light in the center of a screen do not act as coplanar data and will cause your track to slide.

  • Layer order matters: Place your occlusion garbage matte layer above the screen tracking layer to properly knock out the overlapping areas.

  • Align the surface: Turn on the perspective option and use the surface tool to align the track's four corners parallel to the screen's bezels.

  • Export the data: Once satisfied, export the Fusion Blackmagic tracking data to your clipboard. For the occlusion, use Mocha's "Align Surface" tool to expand the corners to fit the frame, then export a second set of tracking data to use for a stabilized rotoscope.

Resolve Fusion Compositing Workflow

Once you are back in Fusion, it is time to build the comp.

  • Preserve the Alpha: Do not composite your screen insert directly inside the tracking tool, as this removes your access to the alpha channel needed for advanced effects later. Instead, set the tracking tool to "Foreground Only" and use a separate Merge node to combine the tracked screen with your background.

  • Add realistic blur: To integrate the screen naturally, apply a Variblur node. You can drive the Variblur using a Background node set to a gradient and reflect pattern to act as a custom depth map. This creates a smoother, tilt-shift style blur that looks much more realistic than standard edge blurring.

  • Extend the edges: You can manually extend the tracker offsets slightly outward so the blurred edges blend seamlessly and believably with the original plate.

  • Restore lighting and grain: To reintroduce the original screen's lighting reflections and film grain, use a Merge node with the "Alpha Gain" slider set all the way down to zero, which acts as an add mode.

  • Soften the integration: Use a Matte Control node, fed by the original mask, to cut out the screen patch and apply a slight edge blur for a perfect blend.

Stabilized Rotoscoping for Occlusions

If a finger or object passes over the screen, you will need to rotoscope it. Using a stabilized workflow makes this painless.

  • Lock the motion: Feed your footage into a Roto node with the operation set to "Perspective Positioning". This effectively stabilizes the moving footage, locking the occluding object in place.

  • Draw the mask: Draw a B-spline mask around the object; because the footage is stabilized, you will need minimal keyframes to keep it accurate. Use a double polyline to add independent softness control to the inside and outside of your mask.

  • Cut out the patch: Use a Brightness/Contrast node set to "Multiply by Mask" to accurately cut out the rotoscoped patch.

  • Reapply the motion: Reapply the original movement to the mask by routing it through a copy of the tracking tool set back to "Corner Positioning".

Final Merge and Color Hand-off

  • Combine the patches: Combine your main screen patch and your rotoscoped occlusion patch using a Merge node with the operator set to "Atop". This prevents a double pre-multiply issue from occurring where the two patches intersect.

  • Manage graphic assets: If you are using an sRGB graphic (like a custom wallpaper) for your screen insert, use a Color Space Transform to convert it into your linear working space before merging so the math works out correctly.

  • Return to Log: Finally, place a CST at the very end of your node tree to swap the footage back from Linear to S-Log3. This ensures your final composite matches the original footage perfectly when you move to the Color page to grade it.

Previous
Previous

Perfect Syncmap Sync

Next
Next

HDR Global Color Balancing in Resolve