We now know how to load in a texture and display it on our air hockey table; we’ve also learned how to reorganize our program so that we can easily switch between multiple shader programs and vertex arrays in our code. We can adjust our textures to fit the shape they’re being drawn on, either by adjusting the texture coordinates or by prestretching or squashing the texture itself.
Textures don’t get drawn directly—they get bound to texture units, and then we pass in these texture units to the shaders. We can still draw different textures in our scene by swapping them in and out of texture units, but excessive swapping may degrade performance. We can also use more than one texture unit to draw several textures at the same time.