ABSTRACT

The fragment shader is very convenient to introduce shadow and fresnel as separate functions. The vertex shader processes individual vertices. It has no information about which form the primitive current vertex belongs to or about other vertices of the current primitive. Geometry shaders receive vertices after they have been processed by the vertex shader but this shader is called per-primitive rather than per-vertex and have access to all vertices of the primitive. The standard Phong and Blinn-Phong models do not obey the energy conservation law – the corresponding integral is not equal to one. But these models can be easily normalized. As an example of geometry shader usage we study a case of extruding a contour line for the input primitives. A contour line is the line where normal is perpendicular to the direction of the observer.