Everything you need to know to create an interactive augmented reality experience.
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 blend shape, created in 3D modeling software. We've included one in the sample content file, that you can use to create all kinds of different 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 blend shapes you'll need. It's listed in the Assets panel as faceDistortionPack.
First, add 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 blend shape 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 blend shape to the face mesh. To do this, select then face mesh then:
Now you've added the blend shape, 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:
When you apply your own object to the face mesh, you'll see a different list of options here.
Play around with the different options here, adjusting the sliders until you're happy with the effect.
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.
To do this yourself, add another face mesh to the scene - again as a child of the face tracker:
Select the face mesh in the Scene Panel. In the Inspector, click the + next to Materials, and select Create New Material to create a new material.
Your project should look like this:
Now select the material - it'll be listed as material0 in the Assets Panel.
In the Inspector:
Below, we've set it to 100%:
You'll also see a box next to an option labeled Full Screen. This applies the smoothing effect across the whole effect. You could uncheck this box to just apply retouching to the face.
You've now finished an effect with retouching and face distortion.
In this tutorial you've learned to distort the shape of the face using a collection of blend shapes. You've also added retouching.
To learn more about creating face effects:
Find inspiration, see examples, get support, and share your work with a network of creators.Join Community