Materials

Materials are art assets placed on an object that give various rendering properties. A highly reflective polish job on a smooth, silver surface or a rough and rugged wooden door with moss growing on the bottom are both examples of Materials. Materials are made up of the Material component itself, shaders, and textures.

While the details of shaders are beyond the scope of this book, we do need a general overview. A shader is a small script file that tells Unity how to react to light. In real life, when light hits a surface, it does not just stop there. Elements such as color, reflectivity, and smoothness can determine the way light bounces around a space. In its effort to simulate this, PBS is designed to take these factors into account at, more or less, real-time speed. Shaders help facilitate this in many ways.

Textures are digital images that a material uses to help give the fine details of a surface, such as the reflectivity or roughness. A texture can also simply be a pattern, such as a pattern of rivets to make the back of a robot, or a highly detailed picture, such as, the front of a soda machine placed on the front of a box to create that illusion with very few polygons used.

Combined, these constituents can help to render beautiful, complex, and detailed worlds.

Now let's go back to our project and ensure that we have LeftRect selected. If we look at the Inspector panel, we should see the Default-Material component near the bottom. Click on the little arrow off to the left of that component, as shown:

In that case, it should expand outward to look like this:

One will assume--after reading what all a material can do--that it is complex; and that is right. With that in mind, we will be touching only parts of the Material overview.

In our Project view, let's navigate to the Materials folder.

Here, we have the Platform material we created in our Hello World project. This time, we will make our materials look a bit better. Blue plastic is kind of boring.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.222.12