Pro OpenGL ES for iOS
178 CHAPTER 6: Will It Blend?^ And one final method here that might be really handy in some blending operations is that of glCol ...
CHAPTER 6: Will It Blend? (^179) Multicolor Blending Now we can spend a few minutes looking at the effect of blending functions ...
180 CHAPTER 6: Will It Blend?^ Figure 6-7. No blending (left), GL_ONE blending (center), alpha blending (right), respectively Te ...
CHAPTER 6: Will It Blend? (^181) static const GLfloat squareColorsYMCA[] = { 1.0, 1.0, 0, 1.0, 0, 1.0, 1.0, 1.0, 0, 0, 0, 1.0, 1 ...
182 CHAPTER 6: Will It Blend?^ //glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); //SQUARE 1 //glEnableCli ...
CHAPTER 6: Will It Blend? (^183) Figure 6-8. On the left, only the textures are displayed. In the center, they’re blended with c ...
184 CHAPTER 6: Will It Blend?^ Figure 6-9. The image on the left has an alpha of .5, while the figure on the right has an alpha ...
CHAPTER 6: Will It Blend? (^185) glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &numberTextureUnits), where numberTextur ...
186 CHAPTER 6: Will It Blend?^ First, we revisit our old friend, drawInRect(). We’re back to only a single texture, going up and ...
CHAPTER 6: Will It Blend? (^187) [self multiTexture:m_Texture0.name tex1:m_Texture1.name]; glDrawArrays(GL_TRIANGLE_STRIP, 0, 4) ...
188 CHAPTER 6: Will It Blend?^ Table 6-2. Possible Values for GL_TEXTURE_ENV_MODE Texture Mode Function GL_ADD Pn+Sn (component- ...
CHAPTER 6: Will It Blend? (^189) Now it’s time to play with other combiner settings. Try GL_ADD for the texture mode, followed b ...
190 CHAPTER 6: Will It Blend?^ Figure 6-12. On the left, GL_ADD was used, GL_BLEND was added for the center, and GL_DECAL was ad ...
CHAPTER 6: Will It Blend? (^191) And similarly you’d use GL_SOURCE1_RGB for Arg1. Table 6-3. Possible Values for GL_COMBINE_RGB ...
192 CHAPTER 6: Will It Blend?^ Figure 6-13. Relatively little detail shows on the left, while with oblique lighting, a lot more ...
CHAPTER 6: Will It Blend? (^193) Figure 6-14. On the left (left), the face is illuminated, which is not the case on the right (r ...
194 CHAPTER 6: Will It Blend?^ shows a bit of our earth map, while Figure 6-15 (right) shows its corresponding normal map. Figur ...
CHAPTER 6: Will It Blend? (^195) z = cos(lightAngle (3.14159 / 180.0)); // Half shifting to have a value between 0.0 and 1.0. x ...
196 CHAPTER 6: Will It Blend?^ Here we set up ‘‘stage 0,’’ the first of two stages. The source of the first bit of data is spe ...
CHAPTER 6: Will It Blend? (^197) Underneath where you allocate the main image, add the following: if(bumpmapFile!=nil) m_BumpMap ...
«
5
6
7
8
9
10
11
12
13
14
»
Free download pdf