Learn Spark AR Studio

Everything you need to know to create an interactive augmented reality experience.

Clear
Back

Extracting the Face Tracker Texture in Spark AR Studio

Use the video of someone's face when they're using the effect as a texture in your scene, by extracting the face tracker texture. You can then apply the texture to a material and object - for example, to create a face swap effect.

To use the video captured of the entire scene, extract the camera texture instead.

Extracting the Face Texture

  1. Insert a face tracker.
  2. Select the face tracker in the Scene Tab.
  3. In the Inspector panel, click + next to Texture Extraction:


You'll see an asset called facetracker0 Texture in the Assets panel:



Using the Texture in an Effect

The texture can applied to any material channel. Or, drag it in to the Patch Editor to use the texture in a visual shader.

The texture can be used in 2 different ways, depending on the effect you're creating:

  • 3D Direct - the texture will have the 2D layout of the face mesh. Use this option to create a 3D representation of the user's face.
  • 2D Bounding box - this is a flat cut out of the user's face.

To select either of these options:

  1. Select the face tracker texture in the Assets panel.
  2. In the Inspector panel, choose an option next to Copy Mode:


3D Direct

3D Direct lets you create a 3D representation of the users face. You could then use this, for example, in a face swapping effect.

In this image below, we've extracted the face tracker texture and set the Copy Mode to 3D Direct. We've then applied it to a material, and applied the material to a face mesh:



If you want to create a face swap effect:

  1. Add a second face tracker.
  2. In the Inspector panel, set Tracked Face to Face 2.
  3. Create a face mesh as a child of the second face tracker.
  4. Create a material for the face mesh.
  5. Extract the face tracker texture for the second face tracker.
  6. Apply each face tracker texture to the material applied to the opposite face tracker in the scene.

The face mesh will have quite hard edges. To blend these use the face mesh mask included in the face reference assets

2D Bounding Box

In this example below, we've extracted the face tracker texture and set the Copy Mode to 2D Bounding Box. We've then applied it to a material, and applied the material to a plane:



You could use the 2D Bounding box mode to create 2D animations, featuring the user's face.

Join the Spark AR Creator's community

Find inspiration, see examples, get support, and share your work with a network of creators.

Join Community

Frequently asked questions

Have a specific question? Maybe it's been answered.


Read FAQs