UMA Material

From UMAWiki
Jump to: navigation, search

The UMA Material asset object is used by Slots and Overlays. This asset is a wrapper for Unity Materials so that the UMA system can properly group identical materials to be atlassed and merged. An UMAMaterial can be created for any type of material.

There are several prebuilt UMAMaterials for most of the commonly used material and shaders, located in UMA/Content/UMA_Core/HumanShared/Materials.

For example, in the "standard" folder;

"UMA_Diffuse_Normal_Metallic" - Unity Standard Shader that accepts albedo, normal, and metallic/roughness texture.

"UMA_Diffuse_Normal_Metallic_Occlusion" - Unity Standard Shader that accepts albedo, normal, metallic/roughness, and ambient occlusion texture.


UMA Material01.jpg

Parameters

Material: Add in a Unity Material here. The Unity Material will have the desired shader to be used set on it.

Channel Size: The number of channels (texture inputs) required by this material. Currently, overlays using this UMA Material are required to set all channels to work.

Channel Type:

Diffuse Texture: Use this for the diffuse or albedo texture.

Texture: This is for data textures e.g, metallic/roughness, specular, AmbientOcclusion, etc...

Normal Map: This is specifically for normal map textures,

Material Color: The color is pulled from the the first fragment, , and applied to the atlas material property.

Tinted Texture: The color is pulled from each fragment, and applied to the base overlay, tinting the fragment in the atlas"

Texture Format: The rendertexture format. See https://docs.unity3d.com/ScriptReference/RenderTextureFormat.html

Material Property Name: The name of the shader property this input corresponds to. See Shader Properties below.

Creating a new UMA Material

Creating a new UMA Material asset can be accessed by the right click menu selecting "Create->UMA Material".

UMA Material Menu02.jpg

Standard Shader Unity Material

1) An UMA Material requires a Unity Material set to it's "Material" input.

2) On the Unity Material, the shader can be set like usual to determine the shader used by the UMA Material and the UMA system.

  • Each different UMA Material creates a new Unity material on the final UMA avatar, so keeping these to a minimum helps performance.
  • Changing property values on the material will affect all textures using the same material on the final UMA avatar. For example, turning down the smoothness on the UMA_Mat_Diffuse_Normal_Metallic (Unity Material) will turn down that smoothness for all textures using that same material on the final UMA Avatar and that may not be the desired result.

3) Set the channels size to the desired number of texture inputs for the material selected.

4) Fill out each channel element to specify the desired texture input. This is important when using the Standard Shader so that it selects the correct variant.

  • Refer to the above Parameters section for details on each parameter.
  • See the Shader Properties section for how to determine a shader's property names.

Shader Properties

Shader Properties are the inputs to a shader. They are used on Unity Materials and UMA Material.

To find a list of all the exact names of the properties on a shader, the shader file itself needs to be selected in the inspector.

Standard Shader

An easy way to select the shader is to select the material that uses the shader in the inspector. Then right mouse click on the material header. A dropdown menu will appear with the option to "Select Shader".

Select Shader01.jpg

Mass Material Update

A quick mass update tool for updating the UMA material on overlays and slot can be found in the global library. Once the overlays or slot section is expanded, the "Utilities" tool can be found at the bottom.

GlobalUpdate01.jpg