Materials

Learn to harness Unity’s materials for total control over object appearance and behavior through shaders.

Introduction

We use materials to define the look and feel of 3D objects. They represent how light interacts with the object and determine how it appears to the viewer. In this lesson, we will discuss what materials are, how they work in Unity and provide a step-by-step guide to using materials.

What are materials in Unity?

In Unity, materials define the appearance of 3D objects by controlling how light interacts with the object’s surface. One or more shaders make up a material, determining how light interacts with the object and any textures, colors, or other properties used to create the object’s appearance.

The user applies material to the “Mesh Renderer” component of a 3D object, which instructs Unity on how to render the object’s geometry. The “Mesh Renderer” component contains references to the materials to render the object.

How materials work in Unity

Unity materials consist of one or more shaders that run on the graphics card and define how the object’s surface reacts to light. A shader takes input from Unity’s lighting system and uses this information to select the final color of the object.

Materials also contain a number of properties, such as the object’s color, texture, and other visual properties. The shader uses these properties to determine the final appearance of the object.

Creating a material

To create a new material in Unity, follow the steps given below:

  • In the “Project” window, under the “Assets” folder, right-click and select “Create” > “Material.”

Get hands-on with 1200+ tech skills courses.