Graphics Reference
In-Depth Information
5
The GLSL Shader
Language
As shader capabilities in graphics hardware have become more flexible, shader
languages have been developed to give the graphics programmer access to
these capabilities. The GLSL shading language was designed to be device inde-
pendent and has been part of the OpenGL standardfrom OpenGL 2.0 forward.
It accomplishes its device independence by having compilers built into the
graphics card driver translate the GLSL code into the specific device instruc-
tions for that card. The actual process of ataching shaders to shader programs,
compiling them, and linking them to be downloaded into the graphics card is
part of the GLSL API, covered in Chapter 14.
GLSL is a very C-like language, with most of the same fundamental
code structure and operators that are found in that language. Thus, there
are no challenges to the graphics programmer in understanding the control
flow, basic operations, or basic data types in the language. However, there
are some areas where GLSL extends the capabilities of C, some areas where
91
 
 
Search WWH ::




Custom Search