ABSTRACT

This chapter discusses the hardware programming concepts and examples will be presented with OpenGL. OpenGL function calls change the state of the graphics hardware and can be used to declare and define geometry, load vertex and fragment shaders, and determine how computation will occur as data passes through the hardware. The variant of OpenGL that this chapter presents is the OpenGL 3.3 Core Profile version. The shading examples presented in this chapter will utilize the GLSL 3.3 Core Profile version shader specification. In modern graphics hardware programming, shaders perform the work of texture lookups and blending, and therefore, must have data about which texture units hold the textures used in the shader. Buffers are the primary structure to store data on graphics hardware. The idea of state in OpenGL mimics the use of static variables in object-oriented classes. As needed, programmers enable, disable, and/or set the state of OpenGL variables that reside on the graphics card.