http://blog.csdn.net/aa4790139/article/details/50963097
Knowledge Points: 1. Input and output of vertex and fragment programs 2. Common meanings 3. Write a simple shader
Input: In output with: out even if input is output: inout
CG Syntax: Cgprogram start to identify ENDCG end identity
Objpos: Semantic Semantic keywords must be made up of all uppercase letters (objpos:position semantics: Objpos represents a position vector) and semantics represent only a running environment inout: Indicates that the input can be returned directly as output (vertex color output col as the input of the fragment program, matching by type, not by name )
Semantic type: POSITION, NORMAL, Binormal, Blendindices, Blendweight, TANGENT, PSIZE, TEXCOORD0 ~ TEXCOORD7
There are two ways to use the output of a vertex: the first type: return col out vertex color output
The second type: Define the structure and then output the structure body
the benefits of defining the structure are: clear, reduce the out,in, if as the output structure, then the inside of the elements are all output, if it is entered as a parameter, then your elements are all input
Tips: Properties under the _maincolor in the inspector color value can not see, also can not be adjusted.
Click on the red box to make it appear