Skip to main content
Version: 4.55.1

Hand and Nails Segmentation

The Hand Segmentation feature allows you to segment effects to within or around the hand or nails. It is similar to other types of Segmentations, except that it does it over a region rather than the full screen.

With Lens Studio 4.46, Nails Segmentation and Nails Object Tracking is out of beta.

To see examples of Hand Segmentation, take a look at the Hand Segmentation template.

To see examples of Nails Segmentation, take a look at the Nails Try-On or Nails Polish objects in the Asset Library.

Adding Hand or Nails Segmentation

To add Hand or Nails Segmentation into your project:

  1. In the Objects panel, press the + button.
  2. Select Hand Segmentation.
  3. Select either Hand Segmentation or Nails Segmentation.

This will add a new setup in your scene that will display a texture segmented within the Hand or Nails.

This setup for both hand and nails has an Image component that contains a special material that uses the Hand or Nails Segmentation as a mask for Texture. This object is a child of a Rectangle Setter which positions the segmented area to be tracked to the hand. Finally, the Rectangle Setter is a child of an Orthographic Camera, which renders these objects which are in screen space.

Applying a texture inside the Hand

In the Objects panel, select the Hand Segmentation object. Then, drag your texture from the Resources panel into the Texture field.

Alternatively, you can click on the Texture field to bring up the texture selector pop up.

Take a look at the Import guide to learn how you can bring your texture into Lens Studio.

Additionally, you can select the Object Segmentation Texture Default material to modify additional options around how your texture is displayed.

  • Segmentation Texture: The Hand Segmentation texture (Resources panel > + > Hand Segmentation)
  • Base Color: choose a color to multiply your texture with
  • TextureUV: choose how your texture is displayed within the Image
  • Radius & Softness: choose how you want to smooth out the segmentation

The Object Segmentation Texture Default material is a graph material. Double-click on it in the Resources panel to open it in the Material Editor and see how it works.

Changing Nails color

To change the color of the nails:

  1. In the Objects panel, select the Nails Segmentation object.
  2. Right click on the materials and click Select.
    1. Alternatively, you can find Nails Segmentation Texture Default in the Resources panel.

After selecting the material, you can change the Base Color property in the Inspector panel.

Using the Hand Segmentation as an Occluder or with 3D objects

The Hand Segmentation texture is a texture that segments out the portion of the camera feed where the hand is, so by default it is used with an Orthographic camera as shown above.

However, you can also use this texture with 3D objects, as well as to occlude 3D objects. Take a look at the Hand Segmentation template to learn how you can do this.

Realistic Nails polish effects

To see examples of Nails Segmentation, take a look at the Nails Try-On or Nails Polish objects in the Asset Library. Use Nails Try-On preset for textured nails and Nails Polish for solid color nails.

To change base nail texture:

  1. Select "Nails Try-On" scene object.
  2. Click and drag your texture from the Resources panel into the Overlay field.
    1. Alternatively you can change contents rendered by the “[Support] Particles” camera.

To change nail color:

  1. Select Nails Try-On scene object.
  2. Right click on the materials and click Select.
    1. Alternatively, you can find “NailsTryOn” in the Resources panel. Then change the OverlayColor field.

Hand and Nails Normal Maps

With Lens Studio 4.46, Nails Try-On now supports built-in textures with hand and nails normal maps. These normals can now can be used to understand the facing direction of the surface.

To see examples of Hand and Nails Normal Maps usage, take a look at the "Holographic Nails" or “Futuristic Nails” objects in the Asset Library

There is no additional performance cost to using both at the same time. You are also able to use these normal maps with Hand or Nails Segmentation and 2D Hand Tracking.

Take a look at Person Normals and Depth for more cases of normal maps usage.

Adding Hand or Nails Normals

To add Hand or Nails Normals into your project:

  1. In the Resources panel, press the + button.
  2. Select Hand Normals.
  3. Select either Hand Normals Texture or Nails Normals Texture.

This will add a new texture resource in your project. You can pass the normal map to a material.

Hand or Nails Normal Maps Positioning

The map needs to be positioned as a hand. To achieve this you should use such a hierarchy with a Rectangle Setter.

  1. Make a child Rectangle Setter object to an Orthographic Camera.
  2. Pass the Normals texture to the Rectangle Setter.
  1. Make a child Image to the Rectangle Setter.
  2. The Scene Object with the Image should also contain Screen Transform.
    1. After adding it the map will be positioned correctly.

Nails Assets

To see examples of Hand and Nails Normal Maps, take a look at the Futuristic Nails or Holographic Nails objects in the Asset Library.

Futuristic Nails

To change nail’s color you can find Nails Material in the Resources panel. After selecting the material, you can change Nail color, Glow color or Highlight color. You can also play with the rest of the material’s parameters by changing animation speed, tilting amplitude, nail density and more.

To change the color of the glow on the hand, select Nails Material and change the value of Hand Glow 0 and Hand Glow 1 colors.

Holographic Nails

To change the nails colors, you can select the object Color Animator in the Objects panel and disable it to control manually or change the script contents to control the animation.

To control the colors manually after turning off the controlling script, select material Nails Material in the Resources panel. Change properties Base Gradient 0, Base Gradient 1 and Highlight Color.

Was this page helpful?
Yes
No