So far, we've been setting colors in the program In game engine design, we used textures instead for the most part 2D Textures: You CAN set these in code Or generate them Or interpret some uninitialized memory as an image, or whatever They're often stored in an image file Tutorial of how textures work in OpenGL 2.0+: Manual application in the fragment shader, basically The world does not always get easier! tut06 covers this, but the image is stored in a C file Let's look at it c++ part vertex and fragment shaders Remember, these were earlier than SHADER_STORAGE_BUFFER Old examples of GPU computation often use a texture to store input arrays How about using a "normal" image file instead? Simple OpenGL Image Loader SDL There are others out there SOIL: No releases for a while, but it works ok Cross-platform Very simple, like the name suggests Available on Debian, Ubuntu, etc. in the package manager All we need it to do is load image files into memory in an appropriate way We don't need an image object with methods to manipulate it SOIL_load_image What makes a good texture? Even lighting Even scale, unless there's a good reason Good enough resolution It will be viewed at a variety of scales It'll stay in GPU memory, but not very many copies If it will be tiled: Edges match, IF you want that Spend some time looking at walls, floors, and ceilings What if you mean something else with a texture? Fragment shader gives flexibility Bricks set in green slime Transparency and textures Textures can be 1D or 3D instead Applying textures to different shape surfaces: Depends what it is, basically You can have a funny texture that wraps around correctly Or simple pieces of it or whatnot Can we make the brick crooked?