You can use Spark AR Studio to change the shape of people's faces. You can also add a retouching effect to faces and the whole scene. In this tutorial you'll learn to do both.
You'll find everything you need to build this effect in the sample content folder. Download it to follow along.
To change the shape of the face you'll need an object called a blendshape created in 3D modeling software. We've included one in the sample content file. Use it to create all kinds of different face effects.
Open the unfinished effect in the sample content folder to follow along. To help you get started quickly we've already imported the set of blendshapes you'll need. It's listed in the Assets panel as faceDistortionPack.
Start by adding a face tracker to your scene:
It'll be listed as faceTracker0 in the Scene panel.
Next, add a face mesh as a child of the face tracker. The face mesh is a 3D model of a face. It works with the face tracker to create a surface that reconstructs someone's expressions. We'll then use the blendshape to change the shape of the face mesh, creating the distorted effect.
To add the face mesh to your project:
You'll see faceMesh0 in the Scene panel, and an object tracking the face in the Viewport and Simulator:
You’ll apply the blendshape to the face mesh. To do this:
Uncheck the Eyes and Mouth checkboxes
Before you adjust the blendshape, you'll need to uncheck the checkboxes next to Eyes and Mouth in the face mesh's properties. This will stop the blendshape from covering and distorting the openings for the eyes and mouth.
Now you've added the blendshape, you'll see an option labeled Morph Object. There's a list of 14 options underneath:
You can adjust these to make all sorts of changes to the shape of the face - from adjusting the size of someone's eyes to completely changing the shape of the face.
Play around with the different options here, adjusting the sliders until you're happy with the effect.
When you apply your own object to the face mesh, you'll see a different list of options here.
In Spark AR Studio a retouching effect is created by adding a material to a face mesh, and changing the Shader Type in the material to Retouching.
Add a face mesh
Start by adding another face mesh to the scene as a child of the face tracker:
Create a material
Next create a material for the face mesh:
Here's how your project will look:
Now select the material to change the Shader Type. It'll be listed as material0 in the Assets panel. In the Inspector:
In the Inspector you'll see an option labeled Full Screen with a checkbox next to it. This applies the smoothing effect across the whole effect. Uncheck this box to just apply retouching to the face.
You've now finished an effect with retouching and face distortion.