Join Craig Barr for an in-depth discussion in this video Introduction to materials, part of Unity 3D Essential Training.
- [Instructor] Unity materials are definitions of how the surface should be rendered including references to textures, any tiling information, and how lighting is going to respond to it as well. So materials, textures, shaders, these are all the things that we work with to get the overall look of an object in a scene. So lets take a look at an introduction to what materials are within Unity. The easiest way to get to a sample material here is in your Assets Directory. You can go to Favorites and let's click on All Materials.
And if we look in here, you can see all the materials associated with what we have so far into our project. So if I wanted to click on something like this door, I can see the Preview window over here. It's going to give me a preview as to what's going on with this material in here. Now if I take a look at how this works in Unity, Unity works on the basis of its uber material, or its uber shader, which is actually referred to as the standard shader and by clicking on that, it's going to give me the Inspector window and see everything related to that material in there.
Now this material came over directly from where how I created things in Maya. So it brought it in everything already pre-set up because I exported this VFVX, I have my textures set up into my Albedo which the basic material that I was using in Maya for this was just a simple blend and I had my Diffuse map into the Diffuse channel in there and Unity will recognize that as an Albedo and that's really what we're talking about here when we look at this. This is the RGB and if you have an Alpha channel, it's RGB-A so this will bring in your Diffuse channel and I had a normal map hooked up there as well and of course, it will read it as a normal map using tangent space normals and it'll bring it in there for you.
So there's our basic materials. So I want to point out how we should store materials or how we can store materials. Now we went ahead and we created this whole directory here of different sub folders in here and we have a Materials directory and in there right now is nothing. Well how can that be? We just did a search of all materials right? Well remember that we used Embed Media, we brought everything over and these things are placed where they live, whether it's character stuff or environments and props, if you have access to the exercise files on this one here for example, you can see that I have a Props directory and because everything came over in this way using the Embed Media, everything that's just come right into here and you can see the associated directories of textures and everything in there and of course, Unity will hook that up for us into a default material as you've seen in All Materials there.
So why did we create this Materials directory if we're not putting all those materials in there? Well, those are fine where they live because of how we exported that and imported them using FBX with embedded media. This Materials directory is going to be where we create our custom materials going forward. So there's the structure for our Material directory. Everything that we create from materials going forward, we'll put into this Materials directory. If you ever need to find materials quickly, you can simply go to All Materials and you can even do a select up here in the Search and do a full search on a specific name or in your Assets directory, you could type in a search for the name and the material and it will bring that up there as well.
So anything related, for example door, is going to bring up all the objects, the normal maps, the texture maps and I have this Door_D in there as well. So that's an overview of how materials work within the directory structure of Unity.
- Setting up a Unity project
- Customizing the UI
- Navigating Unity
- Exporting and importing assets for Unity
- Creating and organizing new materials
- Creating, exporting, and importing prefabs
- Level building
- Creating and implementing animation
- Optimizing collisions
- Baking lighting
- Packaging your Unity project