Pro OpenGL ES for iOS
158 CHAPTER 5: Textures^ chip, while the later ones use the more powerful PowerVR SGX GPU. The advantage of the later ones is th ...
CHAPTER 5: Textures (^159) Table 5-5. The Four PVR Formats Generated by PVRTexTool Format Compression Details GL_COMPRESSED_RGBA ...
160 CHAPTER 5: Textures^ m_Scale=radius; m_Squash=squash; colorIncrment=255/stacks; if ((self = [super init])) { m_Stacks = stac ...
CHAPTER 5: Textures (^161) //The second one float phi1 = M_PI ((float)(phiIdx+1) (1.0/(float)« (m_Stacks)) - 0.5); float cosPh ...
162 CHAPTER 5: Textures^ (1.0f/(float)(m_Slices-1)); tPtr[0] = texX; tPtr[1] = (float)(phiIdx+0) *« (1.0f/(float)(m_Stacks)); tP ...
CHAPTER 5: Textures (^163) m_Pos[0]=0.0; m_Pos[1]=0.0; m_Pos[2]=0.0; return self; } So, here is what’s happening: A file name ...
164 CHAPTER 5: Textures^ Figure 5-21. Textures typically fill out the entire frame, edge to edge. Planets use a Mercator project ...
CHAPTER 5: Textures (^165) glColorPointer(4, GL_UNSIGNED_BYTE, 0, m_ColorData); glDrawArrays(GL_TRIANGLE_STRIP, 0, (m_Slices+1)2 ...
166 CHAPTER 5: Textures^ Summary This chapter served as an introduction to textures and their uses. It covered basic texture the ...
Chapter 6 Will It Blend? Yes! It blends! -----Tom Dickson, owner of the Blendtec blender company In 2006, Tom Dickson posted a g ...
168 CHAPTER 6: Will It Blend?^ If an object isn’t using texturing but instead has its color specified via its vertices, lighting ...
CHAPTER 6: Will It Blend? (^169) glLoadIdentity(); glTranslatef( (GLfloat)(sinf(transY)/2.0),0.0, -3.0); //6 glDrawArrays(GL_TRI ...
170 CHAPTER 6: Will It Blend?^ But we want two squares to show how they can blend. So in line 5, the color is changed to red a ...
CHAPTER 6: Will It Blend? (^171) It’s not much to look at, but this will be the framework for the next several experiments. The ...
172 CHAPTER 6: Will It Blend?^ used, with an increasingly smaller proportion reserved for the destination color. So as the alpha ...
CHAPTER 6: Will It Blend? (^173) So, what’s happening? The blue has an alpha of 1.0, so each blue fragment completely replaces a ...
174 CHAPTER 6: Will It Blend?^ Figure 6-3. Blending full intensities of red and blue Now it’s time for another experiment of sor ...
CHAPTER 6: Will It Blend? (^175) Figure 6-4. The left is drawn with blue first (left), while the one on the right is drawn with ...
176 CHAPTER 6: Will It Blend?^ Table 6-1 has all of the allowable OpenGL ES blending factors, although not all are supported by ...
CHAPTER 6: Will It Blend? (^177) square’s color. The math yields a final color with red=.5, green=0, and blue=-.25. But because ...
«
4
5
6
7
8
9
10
11
12
13
»
Free download pdf