In this post, I'll guide you through 3 examples of different filters preparation in DeepAR Studio. The cases I talk about here are pretty simple, and you can use them if you're new to Studio.

Here are the filters we'll use and set up:

  1. Aviators

  2. Lion

  3. Kitten

All of the assets used here are available to download for free at the bottom of this post.

Aviators

This example will show how to prepare a rigid model effect for the DeepAR Studio - we'll be using an aviators glasses model.

The first step is to load the aviators_v6.fbx model in the scene.

  • Go to File → Import Legacy FBX → choose aviators_v6.fbx in the examples/aviators folder.

As you can see in the image above, there are two groups of geometries in the scene. The first one is the aviators model and the second one is the face model. The face model acts as an occlusion mask for glasses, i.e. when the user turns his head, certain parts of aviator glasses need to be occluded. However, the mask must be transparent, so the user's face is visible. To achieve that we'll need to disable RGB writing for the material:

  • Select Mesh node under RootNode in the Node hierarchy

  • In the Material properties uncheck the RGB enable checkbox

  • The Depth write mode must still be enabled for occlusion to work

Next, we need to load the texture which will be applied to the aviator glasses model.

  • Go to the Textures tab

  • In texture list panel hit Add → Texture → choose aviators_v3.png in the examples/aviators folder.

Once we've loaded the texture, we'll need to apply it to materials.

So, for every material in the scene, we'll set the shader to Unlit texture and Diffuse texture uniform to aviators_v3.png texture, except for the material that is responsible for lenses (lens1 and lens2).

For lenses material we'll use a different shader because we want the lenses to be colored and semi-transparent. To get there, we will use the Standard shader.

Select the lens1 and lens2 and set them a Standard shader.

Under Blend mode choose Alpha mode.

Here are the parameters used to set shader uniforms:

  • Diffuse Color - R: 146, G: 0, B:12, opacity: 35%

  • Specular Color - R: 255, G:255, B:255, opacity: 25%

  • Ambient Color - R:0, G:0, B:0, opacity: 100%


(Optional) Model positioning - fine tuning

Sometimes models produced by the artist aren't 100% to scale. As you can see in the image above, the glasses are positioned a little low on the nose. Let's correct that within DeepAR Studio.

  • In Node hierarchy select RootNode → Mesh → aviators node

  • Now set the new values for Position under Transformations

  • Enter value 1 for Y position, and -2 for Z position

  • Click Reload (make sure the Z position text box has lost focus before that)

As you can see the glasses are now positioned a bit higher, which is what we wanted in the first place.

Lion

In this example, we'll learn how to use a mesh that is driven by bones. You can find lion.fbx and lion.png in the examples/lion folder. The lion.fbx contains skinned mesh using the bones/joints that are specifically named so the DeepAR engine can make the connection between a specific face point and the bone. Here's what you need to do to create a lion mask:

  • Open the DeepAR Studio

  • Go to File → Import Legacy FBX → choose lion.fbx in the examples/lion folder

Now we'll load the texture

  • Go to the Textures tab and click Add → Texture → choose lion.png in the examples/lion folder

  • Select the "PNG - 100%" texture quality to ensure transparency is displayed correctly

Next, we'll assign the texture to the material

  • Select the Mesh under RootNode

  • Under Material properties for Select shader choose Unlit Texture

  • For Diffuse texture selected the lion.png

If everything is done correctly, you should immediately see the lion mask on the face. Since lion.fbx already has correctly skinned mesh with properly named bones, everything works out of the box.

Kitten

In this example, we have the face model with applied cartoon-like kitten ears and nose. Here's how you can create it:

  • Open the DeepAR Studio

  • Go to File → Import Legacy FBX → choose kitten_v4.fbx in the examples/kitten folder

Next, we need to load the texture

  • Go to the Textures tab and click Add → Texture → choose kitten_v2.png in the examples/lion folder

The next step is to assign the texture to the material

  • For each quad under RootNode (ear1, ear2 and muzzle) set the same shader and texture

  • Under Material properties for Select Shader choose Unlit Texture

  • For Diffuse texture choose kitten_v2.png

Here’s the final result:

Download this examples with all assets

Did this answer your question?