Introduction to vertex shader & pixel shader
1. Fixed-function graphics processing pipeline (fixed function graphics pipeline)
The graphic processing assembly line for graphics cards that can implement vertex shader and pixel shader is called programmable. In contrast, the graphic processing assembly line before this is called a fixed function ), the following is a simplified image of OpenGL image processing:
The complete OpenGL Graphic Processing assembly line is called OpenGL machine (which can be found in the OpenGL reference manual). Like a circuit diagram, there are many switches on it, we can turn on or close these switches, and set parameters of each processing unit in the figure to control the processing method. However, the entire system function has been determined, you only have the right to use or not use certain functions and to control the specific execution methods of certain functions, and cannot implement your own customized functions. Therefore, such a graphic processing pipeline is called a fixed function. (Powerful graphics card manufacturers have added many OpenGL extensions to their own OpenGL implementations to implement functions not available in some standard OpenGL specifications. Now they have a programmable graphics pipeline, generally, users also have the opportunity to implement some customized functions .)
2. vertex shader & pixel shader
Although the graphic assembly line implementing vertex shader and pixel shader functions is called programmable, it is actually only a part of the pipeline, just as vertex shader and pixel shader literally mean, currently, only the units that process vertices and pixels are programmable.
Vertex shader and pixel shader have different names in different documents. NVIDIA calls vertex shader vertex program in its own OpenGL extension and pixel shader texture shader, 3dlabs puts forward an OpenGL 2.0 proposal and calls the two vertex shader and fragment shader respectively. Aside from the differences in naming conventions, the actual functions are similar. The following section provides a perfect explanation for this situation:
Shader or program? Shader has been used as the preferred name as this fits in with common usage in renderman and dx8. there is some argument that shading has connotations of being a color operation so doesn't fit with a vertex
Operation. renderman doesn' t make this distinction, nor does dx8. it seems wise to go along with the common usage of shader as a general term for a program which operates on some part of a graphics pipeline.
(Shader or program. In renderman and dx8, the shader name is usually used. This claim is controversial because shading implicitly represents a color operation that is not suitable for describing vertex operations. However, the difference between renderman and dx8 is ignored. Therefore, it seems wise to follow the usual call to use the shader as a general term for the program that takes effect in some parts of the graphic processing pipeline .)