How to Create an AR Makeup Try-On Tool in 15 Minutes or Less [Tutorial]
Tags: tutorial, programming, showdev, augmentedreality
Published: 2021-04-22 20:32:01

Looking to create a makeup try-on tool to virtually try makeup in augmented reality (AR)? This simple face makeup demo created with Unity, AR Foundation, and echo3D is a great place to start. The full demo can also be found on echoAR’s [GitHub](https://github.com/echoARxyz/Unity-ARFoundation-echoAR-demo-Face-Makeup).

![1.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1619123116644/FpKQL5H6u.png)

## Register

Don’t have an API key? Make sure to register for FREE at [echo3D](https://www.echo3d.co/register).

## Setup
* Create a new Unity project.
* Clone the [Unity-ARFoundation-echoAR](https://github.com/echoARxyz/Unity-ARFoundation-echoAR) sample code.
* Open the sample scene under *AR Foundation\Scenes\FaceTracking\FaceMesh.unity*.
* [Set your API key](https://docs.echoar.xyz/unity/using-the-sdk) in *echoAR.cs* inside the *echoAR\echoAR.prefab* using the the inspector.
* Select *AR Session Origin* in the hierarchy. Double click *FaceMeshPrefab* under *AR Face Manager* in the inspector. Set *Material Size* to 1
* [Add an image hologram](https://docs.echoar.xyz/web-console/manage-pages/content-page/how-to-add-content) by uploading the *[makeup.png](https://github.com/VivianVKJ/Unity-ARFoundation-echoAR-Face-Makeup/blob/main/images/makeup.png)* file from the [images](https://github.com/VivianVKJ/Unity-ARFoundation-echoAR-Face-Makeup/tree/main/images) folder to the echo3D console.
* Overwrite the existing echoAR/CustomBehaviour.cs script with the new *[CustomBehaviour.cs](https://github.com/VivianVKJ/Unity-ARFoundation-echoAR-Face-Makeup/blob/main/CustomBehaviour.cs)* file.

## Create Makeup Texture

Make sure to use an Alpha transparent texture as a custom shader. The example texture contains eye shadows, eye liners, highlight, lipstick or other coloring. When running the app, it detects a face and overlays the face material.

To create a makeup texture on your own, open the  *[.psd](https://github.com/VivianVKJ/Unity-ARFoundation-echoAR-Face-Makeup/blob/main/model/canonical_face_texture.psd)* file in the [model](https://github.com/VivianVKJ/Unity-ARFoundation-echoAR-Face-Makeup/blob/main/model) folder. This model is provided by Google’s  [ARCore Augmented Faces Demo](https://developers.google.com/ar/develop/developer-guides/creating-assets-for-augmented-faces).


![2.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1619123336435/jfkd0NeT-.png)

## Learn more

Refer to our [documentation](https://docs.echoar.xyz/unity/) to learn more about how to use Unity and echoAR.

## Support

Feel free to reach out at support@echo3D.co or join our [support channel on Slack](https://go.echo3d.co/join).

## Screenshot

![3.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1619123374204/Eit1iGhsx.gif)

*****
> _echo3D (http://www.echo3D.co; Techstars ’19) is a cloud platform for augmented reality (AR) and virtual reality (VR) that provides tools and server-side infrastructure to help developers & companies quickly build and deploy AR/VR apps and experiences._


![4.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1619123376579/O7EedPhNM.png)