Hand Segmentation
Hand Segmentation isolates the subject's hands, allowing you to apply customized textures and effects to them.
Requirements
Segmentation has a very high performance impact on iOS devices. Segmentation should not be combined with many other features as doing so will cause low FPS and may subsequently lead to not passing QA
Add Hand Segmentation
To add a Hand Segmentation object:
- Open Effect House.
- Go to the Hierarchy panel.
- Click the Add object button [+].
- Go to Segmentation.
- Select Hand Segmentation.
A Segmentation material will automatically be added to the Material property of the Image component when adding a Hand Segmentation object. Segmentation material is useful for quickly adding commonly used segmentation effects to the scene.
Components
The Hand Segmentation object is made up of the following components, found in the Inspector panel:
Demo Effect: Hand Segmentation
In this section, you’ll learn how to create a hand shadow effect.
Download the following file to follow along:
Add a Hand Segmentation object:
- Go to the Hierarchy panel.
- Click the Add object button [+].
- Go to Segmentation.
- Click Hand Segmentation.
Then add an Image object:
- Clik the Add object button [+].
- Go to 2D.
- Click Image. This will be the background image.
Create the hand shadow effect:
- Remove the canvas and 2D camera that were added with the image. You only need one 2D camera and one canvas in the scene.
- Drag the Image under the Hand Color object so that it will render behind the hand segmentation.
- Rename it to Background.
- Replace the texture of this Background image to background.
- Adjust its size in the Scene view to fill the screen.
- Select Hand Segmentation Texture from the Assets panel.
- In the Inspector panel, change its Cutout Texture to the black hand texture you prepared. Now feel free to try it on your hand.