Join Alan Thorn for an in-depth discussion in this video Materials overview, part of Cert Prep: Unity Materials, Lighting, and Effects.
- [Instructor] In this chapter, we're going to be focusing on materials and textures. And looking specifically at what they are and how they work inside Unity. Now in short, a material is simply an algorithm or a recipe sheet for defining how the surface of an object looks. Take for example, the scene that you can see in front of you inside the Unity editor here. This scene is included inside the course companion files. You can find this inside the Chapter 101 folder.
And we have this scene that is open here. Now this scene is based on the shader calibration scene which you can download for free from the Unity Asset Store. To access the asset store, you simply have to choose Window, and the select Asset Store. And if you search the asset store for shader calibration scene, you'll be able to download and import exactly the scene that we have here. But this is included inside the Unity project in the exercise files.
So you can open up that scene file and get access to this scene. And this is a really great scene for demonstrating materials, how they work, and the difference they make to the surface of objects. So at the center of the scene here, you can see I've got this ink stand. And it's a pretty mundane, ordinary ink stand and I can use viewport controls to cycle through the scene and to take a look at the surface of this object. You can see that in the upper part here, we've got this kind of blue plastic shiny material.
And in fact, as I move the camera around, you can see that we get the shine on this material, again moving around the object depending on our field of view, to kind of simulate real world plastic shiny behaviors. And we get a similar thing if I move inside the object. You can see again, and not only does it have this blue plastic appearance, but it's also got these specular highlights that again shift depending on my field of view. Now one of these properties that control the shininess and the smoothness and the surface of an object, is controlled by an object's material.
Now we can access the material for any object simply by selecting the object here inside the hierarchy view. And in the case of this object here, this depends upon a particular hierarchy. In fact, you can see from the hierarchy panel, that we have this hierarchy here. I can select here for example, the SamplePotBody which again selects this mesh, highlighted by this orange border here. And if I move over to the object inspector, you can see that we have the Mesh Renderer component, which has again, different properties that define how this object is rendered.
Now at the bottom of the Mesh Renderer component, you can see that we have a Materials rollout here and this defines all the different materials that are applied to this object. An object can have more than one material. If I expand the Materials slot, you can see that in this case, we do only have one material. We can easily locate and find that material inside the project panel, simply by moving down to the Element zero slot and left-clicking on that material here. And straight away, it selects that material for us.
So for example, if I select the sample here, you can see that in selecting this, we have this material selected and we can see all of the material's properties here inside the object inspector. So that's a pretty easy way in which we can select and view the properties of the selected material. For example, I could move to the lid object here inside the scene. So I can choose SamplePotLid, and once again inside the Mesh Renderer, you can see that for this object in this case, we in fact have two separate materials.
We have element zero and zero one. So for example, I can click on that object to select that material and then select that separate material here. So this is basically what a material is. It is a collection of properties that define how the surface of this object looks. In the next movie, we're going to dive deeper into the world of materials and consider both textures and materials.
- Creating materials
- Textures and mapping
- PBR materials
- Tiling and offsets
- Texture animation
- Getting started with lighting
- Light baking
- Dynamic and emissive lighting
- Creating profiles