Patch Editor
Render Pass Patches
Face Distortion with Render Passes

Face Distortion with Render Pass Patches

Use the Face Distortion patch group to add face distortion to projects made with Render Pass patches.

The Face Distortion patch group can only be used in projects using the custom render pipeline.

Creating the Face Distortion patch group

Before you start, make sure your project includes a blend shape with a material applied to it and a face mesh. Blend shapes are created using external software, then imported into Spark as an asset. You can download a blend shape and learn how to add it to a face mesh in this tutorial

To add face distortion with render passes:

  • Import a blend shape into your Spark AR Studio project.
  • Apply the blend shape to a face mesh.
  • In the Assets panel, select the material applied to your blend shape - it’ll be labelled faceWarpMaterial.
  • Next to Render Pipeline, click Create.

The Face Distortion patch group will be added to the Patch Editor.

Connected as inputs to the group you’ll see:

  • A patch representing the camera texture. The camera texture is the video feed captured when your effect is open in the camera, represented as a texture in the project.
  • A patch representing the face mesh, which is the object with the blend shape applied to.

The output of the patch group is connected to a patch representing the Screen Output property in the Device scene object. This renders the texture, with distortion, in the scene.

Inputs

NameDescription

Scene Object

Connect a patch representing the face mesh you want to distort.

Texture

Connect the camera texture here.

Output

NameDescription

Texture

A texture with the distorted face mesh.

Example

In the example below, the Face Distortion patch group renders a face mesh with a blend shape applied to it in the scene. A Scene Render Pass patch renders the children of a null object - a plane and a text object:

Was this article helpful?