OpenGL Graphics Textures
Quiz You didn't see that coming!
1. What is OpenGL?
2. What is a vertex?
3. What are the three steps to render with depth testing?
4. What is the difference between an orthographic and a perspective projection matrix?
5. What are the three components of the fixed functionality lighting model?
Textures
What is a Texture? Image applied to geometry.tga,.jpg,.png files 1, 2 or 3 dimensional!
Texture Coordinates Vertex attribute Values between 0 and 1 1, 2 or 3-dimensional OpenGL will interpolate between the vertices
TextureTriangle
Sampling Textures Exceedingly rare that the texture will fit the geometry exactly We need a way of mapping to the best representative texel Nearest-neighbour filtering Bilinear filtering
Mipmaps Used to improve the sampling quality
Mipmaps Can specify mipmap level when loading a texture into OpenGL glGenerateMipmap() Trilinear filtering
OpenGL Texture Objects Stores a texture in GPU memory and holds texture properties glGenTextures() glBindTexture() glTexImage2D() glTexParamf() glDeleteTextures()
Demo
Questions?