3D Objects


A comparison of a 3D glasses effect with and without the use of an occluder.

Occluders make AR effects more realistic by hiding things that would be hidden in real life. They're particularly useful when you're placing 3D objects on someone's face.

Occluders are made using an object and a material.


In the image on the left there's no occluder. The arm of the glasses is visible when it should be hidden by the head. On the right we've added an occluder that covers the face. The arm of the glasses is no longer visible:

A comparison of a 3D glasses effect with and without the use of an occluder.

Choosing an occluder object

Any 3D object can be used as an occluder.

Occluding the face

If you're occluding the face, use a face mesh. This will cover the face and respond to its movements.

Occluding the head

To occlude the volume of the entire head, use the head occluder object included in the Spark AR Studio face reference assets.

Adding and editing the material

Once you've created a material, in the Inspector change:

  1. The Shader Type to Flat.
  2. Opacity to 0%.

The material will be transparent, but still hide objects behind it.

In the material's properties you might want to check the box for Double Sided. For example, so the back of the face mesh is also occluded if the user turns their head to the side.

Occluders and layers

Objects that act as occluders should always be assigned to a separate layer from other objects. Make sure the layer with the occluder on is set to render before the layer with objects that are being occluded.

Learn more about adding and adjusting layers to change the render order.