Avatar SDK Local Compute Unity plugin  2.2.2
Toolset for Head 2.0 avatars generation in Unity3D
Scene #04: LOD Sample

This scene demonstrates how to get various LOD (Level Of Details) for the generated avatar's mesh and blendshapes.

HEAD 2.0 pipeline ("head/mobile" subtype)

Eight LODs are available for the avatar:

  • LOD0: corresponds to the base head mesh, contains 11894 vertices and 23404 triangles.
  • LOD1: contains 9969 vertices and 19054 triangles.
  • LOD2: contains 8732 vertices and 16860 triangles.
  • LOD3: contains 5713 vertices and 11007 triangles.
  • LOD4: contains 4953 vertices and 9497 triangles.
  • LOD5: contains 4259 vertices and 7889 triangles.
  • LOD6: contains 3789 vertices and 6937 triangles.
  • LOD7: contains 2034 vertices and 3926 triangles.

bust/mobile subtype doesn't support LOD

There is a set of options specific for HEAD 2.0 pipeline (both subtypes: head/mobile and bust/mobile):

  • A number of faces in the generated haircut. Initially, we generate a haircut. If the haircut's polygons count is more than the requested value, the number of polygons will be downscaled. Otherwise, the polygons number remains the same. The default value is 5000. We don't recommend setting polygons number less than 1000.
  • Size of the resulting model's texture. Upper bound is 4096 x 4096. Usage of values greater than 2048 x 2048 seems to be not reasonable.
  • Size of generated haircut's texture. Upper bound is 4096 x 4096. Usage of values greater than 1024 x 1024 seems to be not reasonable.

User interface and the scene

There are buttons to generate avatar: from the predefined photo, from the photo stored on the filesystem or take a photo by a web camera or camera on a mobile device.

The panel in the bottom right corner contains toggles to switch between different levels of details.

There are controls to apply blendshapes for the avatar in the bottom of the scene.

Also, there is a possibility to export avatar with the given LOD to OBJ or FBX formats.

Implementation

See the LODSample.cs for implementation details. The key component is the IAvatarProvider. To get a particular LOD mesh the GetHeadMeshAsync method is used.

See also FAQ and the getting started instructions on the main page: Main Page.