Unity Learning Note Five add material for prefab

Source: Internet
Author: User

in this note, we will use unity to create and use materials to add materials to our prefab. this series of tutorials and footage is based on the translation tutorial "Unity Game Engine Basics Video Tutorial" from the Everyone's material translation group, which is attached to the second study note. To continue with what was recorded in the last note, in Project view, we can see a material ball with no texture in the importedassets-meshes-materials, which is followed by our 3d The default material for the MAX model. Because we're going to add our own material here, we'll just delete the material ball.

after deletion, we see that the original prefab color has also changed.

Next we create a new material (Material), named Stone_floor, under the Materials folder. Now this is a blank material, we want to choose a shader for him, Unity provides a very diverse shader (shader), here we do not do in-depth discussion, the direct selection of bumped specular (bump highlight), which is a very common shader. bumped specular can be seen from the bottom up, basemap and normal map (base map and normal map), shininess is the reflection, specular color is the highlight color, and Main color doesn't need to be explained.

Now that we haven't imported any textures (Texture), let's import the textures. first create a new folder under the Importedassets folder, named Textures, and enter the textures to introduce our first texture. Right-import-new Assets, then go to our engineering file and find the texture we're looking for. The path is: Imported assets--textures--floor_tile_diffuse.tga. The assets file is:Http://pan.baidu.com/s/1bn8MSlL
after introducing the texture map, select it and move your gaze to the Inspector view, first the texture type, the type of material, Texture,normal map (normal map), etc. Here we choose texture, if you want to make the game interface similar to the first person shooter, we can choose the GUI related type.

Next is the second texture, which continues right-click Import New Assets, introducing Floor_tile_normal_output.tga. As the name implies, we can see that this texture is our normal map, we can modify its texture type to normal map directly in the Inspector view, but unity can be automatically detected to make corrections to the stickers we provide, So here we don't change the type of the second texture first. let's go back to the Materials folder and find the new material ball we created earlier to add a decal to him. There are two ways of doing this:The first method iswhen the material ball is selected, move to the Textures folder and drag the two material directly to the corresponding location. Below we drag the base map past. After dragging, we will see the effect of this texture in the lower corner. The second method is to select the texture by selecting the Select button in the Normalmap blank texture box. We selectedFLOOR_TILE_NORMAL_OUTPUT.TGA, you can import it by double-clicking.



at this point, you will find that the texture is not normal, because unity does not now recognize the normal map. We see a line of fine print above the effect display graph, this texture are not marked as a normal map. It is because we did not modify the texture type when we introduced it, so we can fix it quickly by clicking Fix Now. this time, back to the second texture we imported, we will find that its type has been revised to normal map.




Now that our material ball has been made, we can drag it to any object we want to give this material.


What's more, we can adjust the number of plates in this place, after selecting the material ball, the Inspector view, the two texture map of the tiling xy is changed to 2, then the ground "tile" will be one more times. Try to keep the values of the two tiling consistent, or sometimes the effect will look weird. we can see the comparison between the ground and the bottom right corner of the two graphs below.



the original author of the video here recommended a powerful texture-making software called substance Designer, can be combined with PS to handle the very details of the texture pattern, we are about to import the two texture is the video author using this software made, Everyone is interested can explore for themselves ~ I really do not use it now. we know how to import textures to make our own materials, and then we introduce several materials to fill the walls and ceiling materials. Under the Materials folder, right-click, Import New Asset, select Rock.sbsar and Woodplank.sbsar under the Project Files Materials folder. We will find that there are two more material balls under the Materials folder. This is the texture of the stone and the plank. to illustrate, these two textures are made using third-party plug-ins, so there is a small drawback that you cannot assign a material ball drag to an object in Project view. We need this to give the material to an object. First select the Rock.sbsar material ball and we'll find more details about the material in the inspector. We need to drag the Little Rock material in the middle of the inspector to give the material to the object. As shown in the second picture below.


In the same way, the stone material is then assigned to the ceiling, and the wood material is assigned to both sides of the wall. So we have finished adding the component material, we select the components in the current scene view, click Apply, we can synchronize the material changes to the prefab so that all the prefab added later will be textured.



at this point, we can already add material to the object ourselves.
2015.2.28 19:42by Mr.losers


Unity Learning Note Five add material for prefab

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.