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 echoAR is a great place to start. The full demo can also be found on echoAR’s GitHub.
Don’t have an API key? Make sure to register for FREE at echoAR.
- Create a new Unity project.
- Clone the Unity-ARFoundation-echoAR sample code.
- Open the sample scene under AR Foundation\Scenes\FaceTracking\FaceMesh.unity.
- Set your API key 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 by uploading the makeup.png file from the images folder to the echoAR console.
- Overwrite the existing echoAR/CustomBehaviour.cs script with the new CustomBehaviour.cs file.
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.
Refer to our documentation to learn more about how to use Unity and echoAR.
echoAR (http://www.echoAR.xyz; 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.