8.5.4. Rationale for linear interpolation of texture during clipping. New vertices are often created when a face is clipped against the view volume. We must assign texture coordinates to each vertex. Suppose a new vertex V is formed that is fraction f of the way from vertex A to vertex B on a face. Further suppose that A is assigned texture coordinates ( s A , t A ), and similarly for B . Argue why, if a texture is considered as “pasted” onto a flat face, it makes sense to assign texture coordinates ( lerp ( s A , s B , f ), lerp ( t A , t B , f )) to V . 8.5.5. Computational burden of hyperbolic interpolation. Compare the amount of computation required to perform hyperbolic interpolation versus linear interpolation of texture coordinates. Assume multiplication and division each require 10 times as much time as addition and subtraction. 8.5.3. What does the texture modulate? How are the values in a texture map “applied” in the rendering calculation? We examine three common ways to use such values in order to achieve different visual effects. We do it for the simple case of the gray scale intensity calculation of Equation 8.5. For full color the same calculations are applied individually for the red, green, and blue components. 1). Create a glowing object. This is the simplest method computationally. The visible intensity I is set equal to the texture value at each spot: I texture s t = ( , ) (or to some constant multiple of it). So the object appears to emit light or glow: lower texture values emit less light and higher texture values emit more light. No additional lighting calculations need be done. (For colored light the red, green, and blue components are set separately: for instance, the red component is I r = texture r ( s, t ).) To cause OpenGL to do this type of texturing, specify:
Chapter 8 November 30, 1999 page 33 glTexEnvf(GL_TEXUTRE_ENV,GL_TEXTURE_ENV_MODE, GL_REPLACE 8 ); 2). Paint the texture by modulating the reflection coefficient. We noted earlier that the color of an object is the color of its diffuse light component (when bathed in white light). Therefore we can make the texture appear to be painted onto the surface by varying the diffuse reflection coefficient, and perhaps the ambient reflection coefficient as well. We say that the texture function “modulates” the value of the reflection coefficient from point to point. Thus we replace Equation 8.5 with: I texture s t I I lambert I phong a a d d sp s f = + × + × ( , )[ ] ρ ρ ρ for appropriate values of s and t . Since Phong specular reflections are the color of the source rather than the object, highlights do not depend on the texture. To cause OpenGL to do this type of texturing, specify: glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE, GL_MODULATE); 3). Simulate roughness by Bump Mapping. Bump mapping is a technique developed by Blinn [blinn78] to give a surface a wrinkled (like a raisin) or dimpled (like an orange) appearance without struggling to model each dimple itself. Here the texture function is used to perturb the surface normal vector, which causes perturbations in the amount of diffuse and specular light. Figure 8.49 shows one example, and Plate ??? shows another.
You've reached the end of your free preview.
Want to read all 385 pages?