Using Shader in Unity

Source: Internet
Author: User

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

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.