Pro OpenGL ES for iOS
138 CHAPTER 5: Textures^ but if you really want it to ‘‘fit,’’ you can attach other parts along the edge or even in the middle. ...
CHAPTER 5: Textures (^139) Figure 5-6. Clipping out a portion of the texture by changing the texture coordinates Textures are no ...
140 CHAPTER 5: Textures^ Figure 5-8. Distorting images can give a 3D effect on 2D surfaces. Textures can also be tiled so as to ...
CHAPTER 5: Textures (^141) Figure 5-10. A mirrored-repeat for just the s-axis (left), the texture clamped (right) Note The probl ...
142 CHAPTER 5: Textures^ Figure 5-12. Stretching a texture across many faces Image Formats OpenGL ES supports many different ima ...
CHAPTER 5: Textures (^143) Also a format requirement of sorts is that, generally, OpenGL can use only texture images that are po ...
144 CHAPTER 5: Textures^ This can now be initialized from viewDidLoad() using the following: [EAGLContext setCurrentContext:self ...
CHAPTER 5: Textures (^145) static const GLfloat textureCoords[] = //1 { 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0 }; static float t ...
146 CHAPTER 5: Textures^ The blend function determines how the source and destination pixels/fragments are mixed together. The m ...
CHAPTER 5: Textures (^147) Notice how the texture is also picking up the colors from the vertices? Comment out the line glEnable ...
148 CHAPTER 5: Textures^ Figure 5-14. Cropping the image using s and t coordinates The mapping of the texture coordinates to the ...
CHAPTER 5: Textures (^149) Figure 5-15. The texture coordinates have a one-to-one mapping with the geometric ones. Now change th ...
150 CHAPTER 5: Textures^ Figure 5-16. Repeating the image is convenient when you need to do repetitive patterns such as wallpape ...
CHAPTER 5: Textures (^151) Figure 5-17. Pinching down the right side of the polygon Armed with all of this knowledge, what would ...
152 CHAPTER 5: Textures^ has no native font support, it’s up to us, the long-suffering engineers of the world, to add it ourselv ...
CHAPTER 5: Textures (^153) Naturally, drawInRect() also needs some changes. Swap out your old drawInRect() for the new and impro ...
154 CHAPTER 5: Textures^ glTranslatef(0.0f,0.5f,0.0f); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); glTranslatef(0.0f,-1.0f,0.0f); glT ...
CHAPTER 5: Textures (^155) Figure 5-19. Two images, both mipmapped, but one’s better looking. What gives? You’ve probably notice ...
156 CHAPTER 5: Textures^ than a pixel, and that is called minification. Filtering is the process used to determine how to correl ...
CHAPTER 5: Textures (^157) are actually using filtering. The shimmery one on top is using the GL_LINEAR and the GL_NEAREST filte ...
«
3
4
5
6
7
8
9
10
11
12
»
Free download pdf