
1. Teaching Computer Graphics Starting with Shader-Based OpenGL 13
state variable gl NormalMatrix has been deprecated. Students can either imple-
ment this matrix themselves, either in the application or the shader, or a normal
matrix function can be added to the mat.h file.
1.6.4 Texturing and Discrete Processing
Most of the pre-3.1 texture functions have not changed with recent versions of
OpenGL. The application sets up a texture object. Texture coordinates can be pro-
duced in either the application a s a ver tex attribute or in the vertex shader and then
interpolated by the rasterizer. Finally, a sampler is used in the fragment shader that
applies ...