Page MenuHomeAnticto

Mutable for Unreal Engine 4 | Change the skin tone of a character
Updated 112 Days AgoPublic

Overview

This article explains how to change a character's skin tone by selecting a new one from a color bar. In this example, a gradient skin color bar is used to get a wide range of color shades by moving a selector slider. Moreover, the blending effect between the character's base color and the color bar tones is introduced to help with a better result.

We recommend visiting the Basic Concepts page before start creating any Customizable Object.

Change the skin tone of a character

The resulting Customizable Object of this example can be found in the Village Demo in Content/HowTo/SkinTone named "SkinTone"

Assets required

  • One material asset or material instance of a character with one color parameter
  • One skeletal mesh of the character with only one material slot
  • One texture asset of the base skin texture of the character
  • One mask texture of the character's skin
  • One texture asset of a "skin color bar" with gradient colors
The assets used in this example can be found in the Village Demo in Content/HowTo/SkinTone

Steps

  1. The first step is to create a basic Customizable Object asset with the Base Object, the Material, and the Skeletal Mesh. Link all the connections with the same name.

In this example, the Customizable Object asset is named "Skin Tone", the Reference Skeletal is "SkinTone_BaseBody", the Material is called “SkinTone_M” and the Skeletal Mesh is the same as the Reference Skeletal’s one.


  1. As the objective is to change the skin tone of a character, a node that can modify the texture parameters of the skeletal mesh's material and apply a "color bar" instead of a simple texture is needed. A Texture Layer node allows modifying a base texture with blending options and masks. From the "Base Color" connection in the Material node, create a Texture Layer node.


  1. With the Texture Layer node selected, at the Graph Node Properties tab, click the "+" button in the Layers sub-tab. This creates a layer that results in two new slots in the Texture Layer node.

Each layer created in the Texture Layer node has two connections: the "Layer X" and the "Mask X" connections.

Still in the Graph Node Properties tab, click to unfold the tab of the new layer created. Choose the blending effect preferred among all the options displayed by unfolding the Effect sub-tab. This effect will determine the visual interaction between the samples from a color bar texture and the base layer.

The Effect in this example is left by default as "Cotle Softlight".

After finishing all the steps, if the colors displayed on the character are not similar to the ones on the color bar, try changing the blending effect.

  1. Create a Texture node by dragging and dropping from the "Base" connection of the Texture Layer node.


  1. With the new Texture node selected, select the base texture for the character in the Graph Node Properties tab. This texture is the one on which the blending effect will be applied.

In this example, the "SkinTone_BaseTexture_D" texture is used.


  1. Create another Texture node from the "Mask 0" connection of the Texture Layer. This node allows setting up a mask (black and white texture) which excludes from the "color variation nodes" the non-skin parts of the character's base texture, in this case, the eyes.


  1. In the Graph Node Properties, select the mask texture.

In this example, for the "Mask 0" connection, the "SkinTone_SkinMask" texture is used.


  1. In the "Layer 0" connection, a texture with color information has to be connected. As the color bar has multiple colors, it is necessary to add a node that takes a sample from this bar's values. Create a Sample Texture node. Link its "Color" connection to the "Layer 0" one of the Texture Layer node.


  1. Create a Texture node from the "Texture" connection of the Sample Texture node. In this node, the skin color bar is to be set up.


  1. In the Graph Node Properties, and with this last Texture node selected, select the skin color bar.

In this example, the" SkinTone_ColorBar" texture is used.


  1. Now, the only remaining node is the one that allows selecting a color value and creates a slider after compiling. Click and drag from the "X" connection of the Sample Texture node to create a Float Parameter node. The "X" connection is chosen because the horizontal values of the color bar texture are the ones that contain the gradient color information.


  1. Select the Float Parameter node and name it in the Graph Node Properties tab. This name is appearing as a title next to the "skin color bar" when compiling.

Change the Default Value if wanted to change the color displayed as default after compiling the first time.

In the example, the Parameter Name used is "Skin Tone" and the Default Value is changed to "0.0" to take the first color of the "skin color bar" as default.

Click the "+" icon of the Description Image to enable the option of showing an image in the slider selector. Name this new connection by clicking on the small sub-tab of this new "0" layer created and changing the default name.

In this example, the Description Image is called "Skin Color Bar".


  1. Back to the Source Graph, connect the "Skin Color Bar" connection of the Float Parameter node to the "Image" one of the Texture node.


  1. Before compiling, check that the Source Graph looks similar to the example below.


  1. Compile. The result in the Preview Instance Properties tab should look similar to the image below.

Try to move the "selector slider" and select a color. It must be immediately visible on the character's skin.

Last Author
ricard
Last Edited
Jun 9 2020, 3:11 PM

Event Timeline

marc moved this document from Restricted Phriction Wiki Document.Mar 11 2020, 8:04 PM
laura edited the content of this document. (Show Details)Mar 12 2020, 6:24 PM
laura edited the content of this document. (Show Details)Mar 12 2020, 6:55 PM
laura edited the content of this document. (Show Details)Mar 13 2020, 11:08 AM
laura edited the content of this document. (Show Details)Mar 13 2020, 11:10 AM
marc changed the visibility from "All Users" to "Public (No Login Required)".Mar 19 2020, 11:23 AM
marc changed the edit policy from "Restricted Project (Project)" to "All Users".
marc added a project: Restricted Project.
marc published a new version of this document.
laura edited the content of this document. (Show Details)Mar 31 2020, 1:47 PM
laura edited the content of this document. (Show Details)Mar 31 2020, 2:56 PM
laura edited the content of this document. (Show Details)Mar 31 2020, 4:05 PM
laura edited the content of this document. (Show Details)Mar 31 2020, 6:09 PM
laura edited the content of this document. (Show Details)Mar 31 2020, 7:01 PM
laura published a new version of this document.
laura edited the content of this document. (Show Details)Apr 2 2020, 9:30 AM
laura edited the content of this document. (Show Details)May 19 2020, 11:52 AM
laura edited the content of this document. (Show Details)
laura edited the content of this document. (Show Details)May 19 2020, 12:15 PM
laura edited the content of this document. (Show Details)May 19 2020, 12:24 PM
laura edited the content of this document. (Show Details)
laura edited the content of this document. (Show Details)May 20 2020, 7:01 PM
laura edited the content of this document. (Show Details)May 21 2020, 9:55 AM
laura edited the content of this document. (Show Details)May 21 2020, 1:25 PM
laura edited the content of this document. (Show Details)
laura edited the content of this document. (Show Details)May 21 2020, 2:47 PM
laura edited the content of this document. (Show Details)May 21 2020, 3:40 PM
ricard edited the content of this document. (Show Details)Jun 9 2020, 3:11 PM