1, Material and Shader relations, a material contains a Shader program, in the Shader The properties set in the Material can be set through the Visual
2, built-in Shader, in 5.0 after the version of most of the old Shader are integrated in the standard Shader , you can set the properties of standard Shader to achieve different rendering effects.
Albedo: Reflective Rate
Specular: Specular reflection
Smoothness: The smoothness of specular reflection
Normalmap: Normal map
Why is it called a normal map, we know that normal (normal) is perpendicular to a face of a straight line, by calculating the angle of the light and the normal to know the angle of the face, and then can calculate the color value to be obtained. If we know the normals on each side of the object, we can render the object in light. But a wall may only have four vertices, that is, only one face, it will be the final rendering effect is very single, assuming that the wall has more of the bump marks of bricks, we add sample to achieve only four vertices to render a very strong sense of detail, the level of the wall is strong , using normal map. In the normal mapping technique, we are storing the normals of each pixel of the wall in a single texture, and the rendering is based on the normals of each pixel to determine their degree of darkness, and this normal map can be used Photoshop The software generates the corresponding normal map from the texture of a single wall. Here, a friend familiar with the normal map will be familiar with the above content.
Heightmap: Height map
Occlusion: Map Absorption
Set the absorption factor after adding a map
Emission: self-illuminated maps and colors
3. Create a custom Shader program
L Create a Material
L Create a custom Shader program
L Specify Shader program for Material ( find based on name defined in Shader file) )
L Assign Material to gameobject to see the effect
4 . Grammar and rules of Shader program
http://blog.csdn.net/zh13544539220/article/details/46925009
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Using Shader in Unity