Graphics Reference
In-Depth Information
powerful than typical CPUs. At the same time, software has been developed
to provide higher-level cross-platform GPU programming interfaces. 3DLabs de-
veloped a GPU programming language called GPLP, which was included in the
OpenGL 2.0 5 specification in 2004. Another high-level GPU language is Cg,
developed by NVIDIA. Both of these are C-like languages designed to allow pro-
grammers to develop code for GPUs without having to know the underlying in-
struction sets.
2.5.2 Vertex and Fragment Programs
The two basic types of user programs are vertex programs and fragment programs ;
each is applied at a different point in the pipeline ( Figure 2.14 ) . In a vertex pro-
gram, the vertices of a primitive are available for access and modification. The
vertex program passes the vertices and associated data to the rasterization stage
where it is rendered as pixels, or more precisely, fragments . A fragment program
is applied to each fragment (pixel) before it is passed on to the framebuffer or tex-
ture map. Vertex and fragment programs are also called shaders .A pixel shader
is another name for a fragment shader.
Application
Vertex program
Rasterization
Fragment program
Display
Figure 2.14 Flow of the GPU rendering pipeline. User programs are applied at the two shaded entry
points: a vertex program can change the geometry of a primitive being rendered; a fragment
program overrides the rendering of the individual pixels. (After [Purcell et al. 02].)
5 OpenGL was originally developed by Silicon Graphics Industries (SGI) as a cross-platform inter-
face for earlier nonprogrammable GPUs
 
Search WWH ::




Custom Search