Contextual Awareness
Semantic Masking

To create this template, you should already have installed ARDK and Lightship HUB.

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 HUB and select the Optimized Object Masking template under Contextual Awareness. You could 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

Just press Play to test the scene.

4 - Play scene

Customize your scene

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

5 - Replace object
6 - Replace object play

Alternatively, you could create the scene structure you like and add the “Object Segmentation” script to any object you need to be masked.

7 - Controller

Under Channel Type, you could select the appropriate segmentation channel.

Ready to build?