Our Unity Face AR SDK is a cross-platform augmented reality platform that supports background subtraction in Unity. It allows developers to create Unity apps with a real-time background changer feature. The background remover works automatically and doesn't require a physical green screen. You can use it as an alternative to Unity chroma key solutions when you need to replace and animate backgrounds for the selfie mobile or web camera.
How to set background changer in Unity
Unity background changer is compatible with face filters and supports multi-face tracking. You can build cross-platform games with face tracking, video chats and augmented reality apps in Unity or even use this feature for mixed reality projects.

How does Unity chroma key and backgrounds subtraction differ
Unity chroma key needs a physical green screen behind a person. The shader then picks and removes a specific color from the background which is usually green. Developers need to avoid colors that match the skin tone so it won’t blend into the background.
Unlike Unity green screen shader, the background segmentation uses a neural network that recognizes not the color but the area which belongs to the person and background. It enables a background removal feature that works automatically, in real-time and requires just a camera.
Read More: Real-time Background Subtraction in Unity
How to change backgrounds in Unity with background subtraction
To test and integrate the background changer in your Unity app:
- Get the latest trial version of Banuba Face AR SDK for Uniyt by submitting the website form. Along with the background changer, you'll be able to test face filters in Unity.
- Download the files to compile the Demo app or integrate the SDK into your project.
- Activate the token. With the SDK archive, you'll also receive the client token. See how to activate it.
- Enable the background segmentation feature in your Unity project. Follow the guide here.
Adding image as background
Adding image as background
- Add texture and video to the project assets
- Run the project and add texture to Background -> Raw Image -> Texture field
Adding video as background
Adding video as background
- Add video player object to the root of the scene
- Add your video file to the Video Player-> Video Clip field
- Create new Render Texture in the project assets
- Add created Render Texture to the Video Player->Target Texture field
- In the Video Player set the field Aspect Ration to the Stretch
- Add created Render Texture to the Background->Raw Image-> Texture field
- Change some parameters of Render Texture: Anti-aliasing - at least 2 samples and Wrap - Repeat
- Run the Project
Want to add Face Filters in Unity? Explore our Unity Face AR SDK!
