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.
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.
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.
Press Play to test the scene.
Customize Your Scene
To add your own objects, you can select a Segmentation group under MaskedObjectsHolder and add objects to the corresponding layer.
Alternatively, you can create the scene structure you’d like and add the Object Segmentation script to any object you need to be masked.
Under Channel Type, select the appropriate segmentation channel.