Information AboutTexture Mapping |
| CATEGORIES ABOUT TEXTURE MAPPING | |
| computer graphics | |
| 3d computer graphics | |
|
Texture mapping is a method of adding realism to a Computer-generated Graphic . An image (the Texture ) is added (mapped) to a simpler shape that is generated in the scene, like a Decal pasted to a flat surface. This reduces the amount of computing needed to create the shapes and textures in the Scene . For instance, a sphere may be generated and a Face texture mapped, to remove the need for processing the shape of the nose and eyes. As Graphics Card s become more powerful, in theory, texture mapping for Lighting becomes less necessary and Bump Mapping or increased Polygon counts take over. However, in practice, the trend has recently been towards larger and more varied texture images, together with increasingly sophisticated ways to combine multiple textures for different aspects of the same object. (This is more significant in real-time graphics, where the number of textures that may be displayed simultaneously is a function of the available graphics Memory .) The way the resulting Pixel s on the screen are calculated from the Texel s (texture pixels) is governed by Texture Filtering . The fastest method is to use exactly one texel for every pixel, but more sophisticated techniques exist. EXAMPLE CODE The following is a Java snippet that produces correct texture Coordinates for a good-looking sphere, like in the picture. This example ''does not'' implement perspective-correct texture mapping, which is a more involved operation. The result from this function, the u, v vector, is fetched to a further procedure, which looks up an image (or Mipmap chain) to extract a color associated with the given point.It is commonplace to not write this function but instead to rely on Hardware facilities for maximum performance. public double {Link without Title} sphereMap(double x, double y, double z, int radius) {
double u, v; v = Math.acos(z/radius) / PI; if (y > 0.0) {
} else {
} return new double {Link without Title} { u, v }; } HISTORY OF REAL-TIME TEXTURE MAPPING Before about 1990 , Affine texture mapping was common place, which goes well with using Fractions . Any polygon is first split into Triangles , the Vertices are aggressively rounded, and then the vertices are converted into fractions. Bresenham's Line Algorithm is used to first draw the edges of the triangle, then Interpolate the texture along the edges and, finally, interpolate the texture within each span. SEE ALSO
EXTERNAL LINKS |
|
|