Avatar SDK Offline Unity plugin  1.9.1
animted_face and head_1.2 pipelines
Scene #06: Cartoonish Avatar Sample

Supported pipelines

Styled Face pipeline was introduced for cartoonish avatars generation. It is the subtype (indie/legacy_styled) of the Animated Face pipeline.
The "cartoonish" effect comprises the avatar's geometry modification and applying additional texture. There are two type of textures for it: Slightly Cartoonish Texture and Cartoonish Texture.
Geometry of the Head 1.2 avatars can't be modified. Only the Slightly Cartoonish Texture can be generated along with the Parametric Eyes parameter.

Models comparison

face_vs_slightly_cartoonish_face.jpg
Animated Face and Styled Face with Slightly Cartoonish Texture avatars
face_vs_cartoonish_face.jpg
Animated Face and Styled Face with Cartoonish Texture avatars
head_vs_cartoonish_head.jpg
Head 1.2 and Cartoonish Head 1.2 avatars

Configuration

Styled Face avatars should be generated with the following parameters for getting the "cartoonish" effect:

  1. Use PipelneType.STYLED_FACE
  2. Set the ComputationParameters.avatarModifications.allowModifyNeck to True.
  3. Configure cartoonish stylization level by varying ComputationParameters.shapeModifications.cartoonishV03 parameters in the range [0..1].
  4. Configure the list of the cartoonish textures that will be generated. ComputationParameters.additionalTextures. There are two textures: slightly_cartoonish_texture and cartoonish_texture.
IEnumerator ConfigureStyledFaceCartoonishParameters(ComputationParameters computationParameters)
{
var parametersRequest = avatarProvider.GetParametersAsync(ComputationParametersSubset.ALL, PipelineType.STYLED_FACE);
yield return Await(parametersRequest);
if (parametersRequest.IsError)
yield break;
// generate all available haircuts
computationParameters.haircuts = parametersRequest.Result.haircuts;
//generate two additional cartoonish textures
computationParameters.additionalTextures.AddValue("base/slightly_cartoonish_texture");
computationParameters.additionalTextures.AddValue("plus/cartoonish_texture");
// this parameter allows to modify neck diameter
computationParameters.avatarModifications.allowModifyNeck.Value = true;
// configure eyes appearence
computationParameters.avatarModifications.addGlare.Value = true;
computationParameters.avatarModifications.addEyelidShadow.Value = true;
//cartoonishV03 paramater specifies the cartoonish level (how much the mesh is modified)
computationParameters.shapeModifications.cartoonishV03.Value = 1.0fs;
}

To generate "cartoonish" Head 1.2 avatar, use the following parameters combination:

  1. Set the ComputationParameters.avatarModifications.slightlyCartoonishTexture to True.
  2. Set the Parametric Eyes Texture, Add Glare and Add Eyelid Shadow values.
ComputationParameters ConfigureHeadCartoonishParameters()
{
ComputationParameters computationParameters = ComputationParameters.Empty;
// make the blurred texture
computationParameters.avatarModifications.slightlyCartoonishTexture.Value = true;
// configure eyes appearence
computationParameters.avatarModifications.parametricEyesTexture.Value = true;
computationParameters.avatarModifications.addGlare.Value = true;
computationParameters.avatarModifications.addEyelidShadow.Value = true;
return computationParameters;
}

Implementation

See CartoonishAvatarSample.cs for implementation details.

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