Part 1, Part 2, Part 3, Part 4, Part 5, [download the Unity3D package]
The previous three posts of this tutorial have introduced surface shaders and how they can be used to specify physical properties (such as albedo, gloss and specular reflections) of the materials we want to model. The other type of shader available in Unity3D is called vertex and fragment shader. As the name suggests, the computation is done in two steps. Firstly, the geometry is passed through a function called (typically called vert
) which can alter the position and data of each vertex. Then, the result goes through a frag
function which finally outputs a colour.