Game Development Reference
In-Depth Information
The preceding diagram is from Amir Ebrahimi and Aras Pranckevčius , who
presented the Shader Programming course at Unite 2008, and represents how
the shader works in Unity. We can get more informaion from the following
website. (Warning: this presentaion might be diicult to understand, since
it showed how to create the shader without using any surface shader and it
used the old version of Unity.)
http://unity3d.com/support/resources/unite-
presentations/shader-programming-course
Let's get back to the diagram—you will see that the shader ile that we are wriing is working
on the vertex and pixel (fragment) level. Then, it will show the result to the frame buffer,
but what are vertex and pixel shaders? These are the different types of processors in the
GPU. First, the vertex processor gets the vertex data, which is the posiion and color of each
vertex in the 3D model; then, draw a triangle from these verices and pass the data to the
pixel processor. The pixel processor will get that value and translate it to the per pixel screen.
It is similar to taking a vector art from Illustrator or Flash and translaing it to a pixel art in
Photoshop. Then, it interpolates color data to each pixel, as shown in the following diagram:
 
Search WWH ::




Custom Search