Material
Manual     Reference     Scripting   
Reference Manual > Asset Components > Material

Material

Materials are used in conjunction with Mesh or Particle Renderers attached to the GameObject. They play an essential part in defining how your object is displayed. Materials include a reference to the Shader used to render the Mesh or Particles, so these Components can not be displayed without some kind of Material.


A Diffuse Shader Material has only two properties - a color and a texture.

Properties

The properties of any Material will change depending on the selected Shader. These are the most often used properties:

ShaderThe Shader that will be used by the Material. For more information, read the Built-in Shader Guide.
Main ColorAny kind of color tint can be applied. Use white for no tint.
BaseThe Texture that will be displayed.

Details

Materials are used to place Textures onto your GameObjects. You cannot add a Texture directly without a Material, and doing so will implicitly create a new Material. The proper workflow is to create a Material, select a Shader, and choose the Texture asset(s) to display along with it. For more information on Materials, take a look at the Manual's page about Materials.

Choosing Shaders

After you create your material, the first thing you should decide is which Shader to use. You choose it from the drop-down Shader menu.

The Shader drop-down menu

You can choose any Shader that exists in your project's assets folder or one of the built-in Shaders. You can also create your own Shaders. For more information on using the built-in Shaders, view the Built-in Shader Guide. For information on writing your own shaders, take a look at the Shaders section of the Manual and ShaderLab Reference.

Setting shader properties

Depending on the type of shader selected, a number of different properties can appear in the Inspector.


Properties of a Specular shader

Properties of a Normal mapped shader

Properties of a Normal mapped Specular shader

The different types of Shader properties are:

Color pickersUsed to choose colors.
SlidersUsed to tweak a number value across the allowed range.
TexturesUsed to select textures.

Texture placement

The placement of the textures can be altered by changing the Offset and Tiling properties.


This texture is tiled 2x2 times by changing the Tiling properties
OffsetSlides the Texture around.
TilingTiles the Texture along the different axes.

Hints

Page last updated: 2010-07-13