As we said, materials are the skin of a model and provide its distinctive look. In the following recipe, we will create two materials that show the difference between a diffuse and transparent material.
As we add an entirely new type of asset to our project in this recipe (didn't we tell you that we were going to create many?), we need to create a folder to store our materials. Open Unity and get ready to follow the instructions of the next recipe!
Assets
folder, then click anywhere and select Create | Folder, as shown in the following screenshot:Materials
, then double-click to open it.filled
, then repeat this operation to create another material and name it Transparent
. At this point, you should have two gray materials in your Materials
folder, one named filled
and the other named Transparent
.filled
. In Inspector, check that Shader is set to Texture under Unlit. This way, our materials won't be affected by light and will simply shine.Textures
folder in the Project panel.By getting the info about transparency from the grayscale of secondTexture and setting transparent as an Unlit/Transparent Cutout material, we caused the checkered cube to appear empty where the dark squares were.
Unity offers the possibility to define several other material types, allowing the use of normal and specular maps and many other effects to improve the look of your models. A detailed analysis of all such materials would go beyond the scope of this chapter about importing 2D assets, so we will stop here. We will delve more into materials in the later chapters.
18.188.218.157