Contextual Awareness
Semantic Masking

To create this template, you should already have downloaded and installed the ARDK and Lightship Hub packages.

How does it work?

Object Masking uses Semantic Segmentation to create a mask layer. This allows you to hide regions of the screen and have your AR objects placed inside those masks.

This example uses a shader to blur the edges of the segmentation channels, giving a more natural feel to the scene.

1 - How it Works

Create the Template

Open the Welcome to Lightship Templates page and select the Optimized Object Masking template under Contextual Awareness.

You can also access it from the menu: Lightship > Lightship Hub > Templates > Contextual Awareness > Optimized Object Masking.

2 - Menu

This will create a series of objects and set up the current scene with all the scripts and components to start working. Once you reach this step, you should have a fully working scene that’s ready to be exported.

To test this template in Unity Editor you’ll need to select a mock environment.

Go to the Lightship Menu > ARDK > Virtual Studio and select Mock. Then, choose an environment.

Make sure to keep the Virtual Studio configuration window open while you play through your scene.

3 - Exterior Mockup

Press Play to test the scene.

4 - Play scene

Customize Your Scene

To add your own objects, you can select a Segmentation group under MaskedObjectsHolder and add objects to the corresponding layer.

5 - Replace object
6 - Replace object play

Alternatively, you can create the scene structure you’d like and add the Object Segmentation script to any object you need to be masked.

7 - Controller

Under Channel Type, select the appropriate segmentation channel.

Ready to build?