Tribute to the original http://blog.csdn.net/onerain88/article/details/19939181
Previously noticed that the properties of the texture in the material have tiling and offset, but did not delve into its purpose, today just know can use offset to do UV animation, to complete a variety of interesting animation, such as streamer effect!
The flow effect is usually a high-gloss light across the object, simulating the effect of high-light moving objects, before the use of shader per frame to pass an offset value, modified high-light texture sampling UV, so as to achieve its effect. In this way, it is necessary to implement shader, the simple same speed movement is very easy to achieve, if you want to move with the degree of change, you need to implement the speed curve of the resolution (and passed to shader) to achieve this.
Did not expect to be used for displacement action, skeletal action of the animation unexpectedly also have this function!
Animation can be used for object rendering (Unity version 4.3 and 4.2 are slightly different)
In the shader section, there are two textures, the basemap and the highlight, and it is important to note that if you want to move the UVS, you must declare their ST properties so that the UV offsets can be computed by the built-in method Transform_tex (), shader as follows
Only a very simple algorithm is used to calculate the final color values, the high-gloss overlay basemap Color increases the high-light alpha-fold, which can be calculated according to demand!
In the animation keyframe, according to the art demand design curve,
Run effect
Note that this method cannot be applied to Ngui because the Ngui is different from the normal object in its organization vertex mode!
Accessories download
Unity3d Development (ix): Unity3d Streamer Effect