opengl graphics textures. quiz you didn't see that coming!

19
OpenGL Graphics Textures

Upload: katherine-hunter

Post on 21-Jan-2016

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: OpenGL Graphics Textures. Quiz You didn't see that coming!

OpenGL GraphicsTextures

Page 2: OpenGL Graphics Textures. Quiz You didn't see that coming!

QuizYou didn't see that coming!

Page 3: OpenGL Graphics Textures. Quiz You didn't see that coming!

1. What is OpenGL?

Page 4: OpenGL Graphics Textures. Quiz You didn't see that coming!

2. What is a vertex?

Page 5: OpenGL Graphics Textures. Quiz You didn't see that coming!

3. What are the three steps to render with depth testing?

Page 6: OpenGL Graphics Textures. Quiz You didn't see that coming!

4. What is the difference between an orthographic and a perspective projection matrix?

Page 7: OpenGL Graphics Textures. Quiz You didn't see that coming!

5. What are the three components of the fixed functionality lighting model?

Page 8: OpenGL Graphics Textures. Quiz You didn't see that coming!

Textures

Page 9: OpenGL Graphics Textures. Quiz You didn't see that coming!

What is a Texture?

Image applied to geometry

.tga, .jpg, .png files

1, 2 or 3 dimensional!

Page 10: OpenGL Graphics Textures. Quiz You didn't see that coming!

Texture Coordinates

Vertex attribute

Values between 0 and 1

1, 2 or 3-dimensional

OpenGL will interpolate between the vertices

Page 11: OpenGL Graphics Textures. Quiz You didn't see that coming!

Texture Triangle

Page 12: OpenGL Graphics Textures. Quiz You didn't see that coming!

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

Page 13: OpenGL Graphics Textures. Quiz You didn't see that coming!

Mipmaps

Used to improve the sampling quality

Page 14: OpenGL Graphics Textures. Quiz You didn't see that coming!
Page 15: OpenGL Graphics Textures. Quiz You didn't see that coming!

Used to improve the sampling quality

Mipmaps

Can specify mipmap level when loading a texture into OpenGL

glGenerateMipmap()

Trilinear filtering

Page 16: OpenGL Graphics Textures. Quiz You didn't see that coming!

OpenGL Texture Objects

Stores a texture in GPU memory and holds texture properties

glGenTextures()

glBindTexture()

glTexImage2D()

glTexParamf()

glDeleteTextures()

Page 17: OpenGL Graphics Textures. Quiz You didn't see that coming!

Demo

Page 18: OpenGL Graphics Textures. Quiz You didn't see that coming!

Questions?

Page 19: OpenGL Graphics Textures. Quiz You didn't see that coming!