Unity3D Surface Shader (Surface Shader) data integration, unity3dshader

Source: Internet
Author: User

Unity3D Surface Shader (Surface Shader) data integration, unity3dshader
1. Shader surface coloring machine syntax

The Surface Shader of Unity is a method of code generation. It is much easier to use it to write a light Shader than to use a low-level vertex/pixel Shader program.


2. Compile a Shader for Grayscale Effect


3. Normal-Diffuse of Shader

Normal-Diffuse is a simple illumination model. The illumination intensity decreases with the decrease of the angle between the surface and the incident angle. The illumination intensity is only related to the incident angle and is not related to the camera.


4. Shader built-in Shader-based Bumped Diffuse Learning

Bumped Diffuse is based on the Lambert illumination model and uses the normal mapping technology to increase the surface details of objects. Normal mapping does not change the shape of an object, but uses a special texture called Normal Map to display the surface details of an object by adding a split. In normal map, the color of each pixel represents the normal of the object where the pixel is located, and then the light is calculated using this normal (instead of the normal calculated by the object model. Normal Map can be said to "efficiently modify" the entire model during the computing of illumination.


5. Vertex learning with built-in Shader

One of the simplest Shader is that all the light that shines on the object is rendered in a Pass, and the light source is calculated only in the vertex. So there will be no pixel-based rendering Effect


6. Shader's built-in Shader Specular Learning

Specular uses the same illumination model as Diffuse, but it adds a reflection highlight related to the viewing angle. A lighting model called Blinn-Phong. This illumination model contains a reflection strong light, which is related to the object surface angle, the incident angle of light, and the observer angle. In fact, this method is a feasible simulation of real-time light source fuzzy reflection. The Blur level is controlled by the Shininess variable.


7. Shader built-in Shader: Bumped Specular Learning

The same illumination model as Specular. Compared with Specular, it uses a Tangent Space Normal Map texture Map to describe the changes of the surface Normal vectors and increase the surface details of objects. Generally, the rendering cost of This shader is relatively high.


8. Shader built-in Shader Diffuse Detail Learning

This is a common diffuse shader with some additional data shader. It allows you to define the second Texture, called Detail Texture. When Camera approaches, the Detail Texture is gradually displayed, which is generally used for terrain. The Detail texture overwrites the main texture. The deep part in the Detail texture will make the winner texture deeper, while the light part will make the main texture brighter, and the Detail texture is usually light gray. (Unlike the Decal Texture in Decal, Decal Texture is RGBA, Decal Texture and Main Texture are controlled by alpha, while Detail Texture is RGB, the two textures are multiplied by the rgb channels and then multiplied by 2. That is to say, when the color value in the Detail texture is equal to 0.5, the color of the main texture is not changed. If the color is greater than 0.5, it becomes brighter, if it is less than 0.5, it will deepen)


9. Parallax Diffuse learning with built-in Shader
Parallax Normal mapped is the same as normal mapped, but it is better to simulate "depth. The extra depth effect is achieved through the Height Map. Height Map is saved in the alpha channel of Normal map.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Related Article

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.