Multiple textures
When multiple textures are used, we need to define each texture before each part of the scene is drawn. Multiple textures, however, can result in long load times if the textured images are large. To avoid long load times, we use OpenGL’s "texture objects". Texture objects are similar to display lists (which are compiled lists of functions and commands and when called, is faster in execution than a manually called list of single commands) in that both have a single number to identify them. The difference between display lists and texture objects is that while display lists can have any drawing calls, texture objects only have texture information. By having such a trait, texture objects allow a 3D hardware to load – and keep - multiple textures into memory instead of having to load them every time. OpenGL will automatically keep the most recent texture objects used in memory. The only problem with this is when the amount of textures (in MBs) exceed the amount of memory on a 3D hardware. In such cases, OpenGL allows another function that lets us determine and specify which textures are the most important ones. This is done by using the glPrioritizeTextures function. Using this function, each texture object is given a number (0.0 to 1.0) and each of these numbers have a priority, with 1.0 being the highest priority. Note that in games, scenes are forever changing – a texture object given the highest priority number of 1.0 may not actually be guaranteed to be kept in memory but it will definitely be available if needed when and if sufficient memory is available.
In summary
|