Texture mapping
Encyclopedia
Texture mapping is a method for adding detail
Complexity
In general usage, complexity tends to be used to characterize something with many parts in intricate arrangement. The study of these complex linkages is the main goal of complex systems theory. In science there are at this time a number of approaches to characterizing complexity, many of which are...

, surface texture (a bitmap
Bitmap
In computer graphics, a bitmap or pixmap is a type of memory organization or image file format used to store digital images. The term bitmap comes from the computer programming terminology, meaning just a map of bits, a spatially mapped array of bits. Now, along with pixmap, it commonly refers to...

 or raster image
Raster graphics
In computer graphics, a raster graphics image, or bitmap, is a data structure representing a generally rectangular grid of pixels, or points of color, viewable via a monitor, paper, or other display medium...

), or color
Color
Color or colour is the visual perceptual property corresponding in humans to the categories called red, green, blue and others. Color derives from the spectrum of light interacting in the eye with the spectral sensitivities of the light receptors...

 to a computer-generated graphic
Computer-generated imagery
Computer-generated imagery is the application of the field of computer graphics or, more specifically, 3D computer graphics to special effects in art, video games, films, television programs, commercials, simulators and simulation generally, and printed media...

 or 3D model. Its application to 3D graphics was pioneered by Dr Edwin Catmull
Edwin Catmull
Dr. Edwin Earl Catmull, Ph.D. is a computer scientist and current president of Walt Disney Animation Studios and Pixar Animation Studios. As a computer scientist, Catmull has contributed to many important developments in computer graphics....

 in his Ph.D. thesis of 1974.

Texture mapping

A texture map is applied (mapped) to the surface of a shape or polygon. This process is akin to applying patterned paper to a plain white box. Every vertex in a polygon is assigned a texture coordinate (which in the 2d case is also known as a UV coordinate) either via explicit assignment or by procedural definition. Image sampling locations are then interpolated across the face of a polygon to produce a visual result that seems to have more richness than could otherwise be achieved with a limited number of polygons. Multitexturing is the use of more than one texture at a time on a polygon. For instance, a light map
Lightmap
A lightmap is a data structure which contains the brightness of surfaces in 3d graphics applications such as video games. Lightmaps are precomputed and used for static objects. Quake was the first computer game to use lightmaps to augment rendering. Before lightmaps were invented, realtime...

 texture may be used to light a surface as an alternative to recalculating that lighting every time the surface is rendered. Another multitexture technique is bump mapping
Bump mapping
Bump mapping is a technique in computer graphics for simulating bumps and wrinkles on the surface of an object. This is achieved by perturbing the surface normals of the object and using the perturbed normal during lighting calculations. The result is an apparently bumpy surface rather than a...

, which allows a texture to directly control the facing direction of a surface for the purposes of its lighting calculations; it can give a very good appearance of a complex surface, such as tree bark or rough concrete, that takes on lighting detail in addition to the usual detailed coloring. Bump mapping has become popular in recent video games as graphics hardware has become powerful enough to accommodate it in real-time.

The way the resulting pixel
Pixel
In digital imaging, a pixel, or pel, is a single point in a raster image, or the smallest addressable screen element in a display device; it is the smallest unit of picture that can be represented or controlled....

s on the screen are calculated from the texel
Texel (graphics)
A texel, or texture element is the fundamental unit of texture space, used in computer graphics. Textures are represented by arrays of texels, just as pictures are represented by arrays of pixels....

s (texture pixels) is governed by texture filtering
Texture filtering
In computer graphics, texture filtering or texture smoothing is the method used to determine the texture color for a texture mapped pixel, using the colors of nearby texels . Mathematically, texture filtering is a type of anti-aliasing, but it filters out high frequencies from the texture fill...

. The fastest method is to use the nearest-neighbour interpolation, but bilinear interpolation
Bilinear interpolation
In mathematics, bilinear interpolation is an extension of linear interpolation for interpolating functions of two variables on a regular grid. The interpolated function should not use the term of x^2 or y^2, but x y, which is the bilinear form of x and y.The key idea is to perform linear...

 or trilinear interpolation
Trilinear interpolation
Trilinear interpolation is a method of multivariate interpolation on a 3-dimensional regular grid. It approximates the value of an intermediate point within the local axial rectangular prism linearly, using data on the lattice points...

 between mipmap
Mipmap
In 3D computer graphics texture filtering, MIP maps are pre-calculated, optimized collections of images that accompany a main texture, intended to increase rendering speed and reduce aliasing artifacts. They are widely used in 3D computer games, flight simulators and other 3D imaging systems. The...

s are two commonly used alternatives which reduce aliasing
Aliasing
In signal processing and related disciplines, aliasing refers to an effect that causes different signals to become indistinguishable when sampled...

 or jaggies
Jaggies
"Jaggies" is the informal name for artifacts in raster images, most frequently from aliasing, which in turn is often caused by non-linear mixing effects producing high-frequency components and/or missing or poor anti-aliasing filtering prior to sampling....

. In the event of a texture coordinate being outside the texture, it is either clamped
Clamping (graphics)
In computer graphics, clamping is the process of limiting a position to an area. Unlike wrapping, clamping merely moves the point to the nearest available value.To put clamping into perspective, pseudocode for clamping is:...

 or wrapped
Wrapping (graphics)
In computer graphics, wrapping is the process of limiting a position to an area. A good example of wrapping is wallpaper, a single pattern repeated indefinitely over a wall...

.

Perspective correctness

Texture coordinates are specified at each vertex of a given triangle, and these coordinates are interpolated using an extended Bresenham's line algorithm
Bresenham's line algorithm
The Bresenham line algorithm is an algorithm which determines which points in an n-dimensional raster should be plotted in order to form a close approximation to a straight line between two given points...

. If these texture coordinates are linearly interpolated
Linear interpolation
Linear interpolation is a method of curve fitting using linear polynomials. Lerp is an abbreviation for linear interpolation, which can also be used as a verb .-Linear interpolation between two known points:...

 across the screen, the result is affine texture mapping. This is a fast calculation, but there can be a noticeable discontinuity between adjacent triangles when these triangles are at an angle to the plane of the screen (see figure at right – textures (the checker boxes) appear bent).

Perspective correct texturing accounts for the vertices' positions in 3D space, rather than simply interpolating a 2D triangle. This achieves the correct visual effect, but it is slower to calculate. Instead of interpolating the texture coordinates directly, the coordinates are divided by their depth (relative to the viewer), and the reciprocal of the depth value is also interpolated and used to recover the perspective-correct coordinate. This correction makes it so that in parts of the polygon that are closer to the viewer the difference from pixel to pixel between texture coordinates is smaller (stretching the texture wider), and in parts that are farther away this difference is larger (compressing the texture).
Affine texture mapping directly interpolates a texture coordinate between two endpoints and :
where
Perspective correct mapping interpolates after dividing by depth , then uses its interpolated reciprocal to recover the correct coordinate:

All modern 3D graphics hardware implements perspective correct texturing.

Classic texture mappers generally did only simple mapping with at most one lighting effect, and the perspective correctness was about 16 times more expensive. To achieve two goals - faster arithmetic results, and keeping the arithmetic mill busy at all times - every triangle is further subdivided into groups of about 16 pixels. For perspective texture mapping without hardware support, a triangle is broken down into smaller triangles for rendering, which improves details in non-architectural applications.
Software renderers generally preferred screen subdivision because it has less overhead. Additionally they try to do linear interpolation along a line of pixels to simplify the set-up (compared to 2d affine interpolation) and thus again the overhead (also affine texture-mapping does not fit into the low number of registers of the x86 CPU; the 68000 or any RISC is much more suited). For instance, Doom restricted the world to vertical walls and horizontal floors/ceilings. This meant the walls would be a constant distance along a vertical line and the floors/ceilings would be a constant distance along a horizontal line. A fast affine mapping could be used along those lines because it would be correct. A different approach was taken for Quake, which would calculate perspective correct coordinates only once every 16 pixels of a scanline and linearly interpolate between them, effectively running at the speed of linear interpolation because the perspective correct calculation runs in parallel on the co-processor. The polygons are rendered independently, hence it may be possible to switch between spans and columns or diagonal directions depending on the orientation of the polygon normal to achieve a more constant z, but the effort seems not to be worth it.

Another technique was subdividing the polygons into smaller polygons, like triangles in 3d-space or squares in screen space, and using an affine mapping on them. The distortion of affine mapping becomes much less noticeable on smaller polygons. Yet another technique was approximating the perspective with a faster calculation, such as a polynomial. Still another technique uses 1/z value of the last two drawn pixels to linearly extrapolate the next value. The division is then done starting from those values so that only a small remainder has to be divided, but the amount of bookkeeping makes this method too slow on most systems. Finally, some programmers
Build engine
The Build engine is a first-person shooter engine created by Ken Silverman for 3D Realms. Like the Doom engine, the Build engine represents its world on a two-dimensional grid using closed 2D shapes called sectors, and uses simple flat objects called sprites to populate the world geometry with...

 extended the constant distance trick used for Doom by finding the line of constant distance for arbitrary polygons and rendering along it.

Resolution

The resolution
Image resolution
Image resolution is an umbrella term that describes the detail an image holds. The term applies to raster digital images, film images, and other types of images. Higher resolution means more image detail....

 of a texture map is usually given as a width in pixels,
assuming the map is square. For example, a 1K texture has a resolution of 1024 x 1024, or 1,048,576 pixels.

Graphics cards cannot render texture maps beyond a threshold that depends on their hardware, possibly the amount of available RAM
Ram
-Animals:*Ram, an uncastrated male sheep*Ram cichlid, a species of freshwater fish endemic to Colombia and Venezuela-Military:*Battering ram*Ramming, a military tactic in which one vehicle runs into another...

.

See also

  • Mipmapping
  • Bump mapping
    Bump mapping
    Bump mapping is a technique in computer graphics for simulating bumps and wrinkles on the surface of an object. This is achieved by perturbing the surface normals of the object and using the perturbed normal during lighting calculations. The result is an apparently bumpy surface rather than a...

  • Clamping
    Clamping (graphics)
    In computer graphics, clamping is the process of limiting a position to an area. Unlike wrapping, clamping merely moves the point to the nearest available value.To put clamping into perspective, pseudocode for clamping is:...

  • Cube mapping
    Cube mapping
    In computer graphics, cube mapping is a method of environment mapping that uses a six-sided cube as the map shape. The environment is projected onto the six faces of a cube and stored as six square textures, or unfolded into six regions of a single texture...

  • Daytona USA (video game)
  • Displacement mapping
    Displacement mapping
    Displacement mapping is an alternative computer graphics technique in contrast to bump mapping, normal mapping, and parallax mapping, using a texture- or height map to cause an effect where the actual geometric position of points over the textured surface are displaced, often along the local...

  • Environment mapping
  • Edwin Catmull
    Edwin Catmull
    Dr. Edwin Earl Catmull, Ph.D. is a computer scientist and current president of Walt Disney Animation Studios and Pixar Animation Studios. As a computer scientist, Catmull has contributed to many important developments in computer graphics....

  • Image analogy
    Image analogy
    An "image analogy" is a method of creating an image filter automatically from training data. In an image analogy process, the transformation between two images A and A' is "learned"...

  • Lightmap
    Lightmap
    A lightmap is a data structure which contains the brightness of surfaces in 3d graphics applications such as video games. Lightmaps are precomputed and used for static objects. Quake was the first computer game to use lightmaps to augment rendering. Before lightmaps were invented, realtime...

  • MClone
    MClone
    MClone, or Clonal Mosaic, is a pattern formation algorithm proposed in 1998 used specially for simulating giraffes and members of the Phelidae family of the mammalians. It was primarily proposed as a 2D model and lately was extended to 3D...

  • Normal mapping
    Normal mapping
    In 3D computer graphics, normal mapping, or "Dot3 bump mapping", is a technique used for faking the lighting of bumps and dents. It is used to add details without using more polygons. A common use of this technique is to greatly enhance the appearance and details of a low polygon model by...

  • Parametrization
    Parametrization
    Parametrization is the process of deciding and defining the parameters necessary for a complete or relevant specification of a model or geometric object....

  • Parallax mapping
    Parallax mapping
    Parallax mapping is an enhancement of the bump mapping or normal mapping techniques applied to textures in 3D rendering applications such as video games...

  • Relief mapping (computer graphics)
  • Texture synthesis
    Texture synthesis
    Texture synthesis is the process of algorithmically constructing a large digital image from a small digital sample image by taking advantage of its structural content...

  • Texture atlas
    Texture atlas
    In realtime computer graphics, a texture atlas is a large image, or "atlas" which contains many smaller sub-images, each of which is a texture for some part of a 3D object. The sub-textures can be rendered by modifying the texture coordinates of the object's uvmap on the atlas, essentially telling...

  • Texture artist
    Texture artist
    A texture artist is an individual who develops textures for digital media, usually for video games, movies, web sites and television shows. These textures can be in the form of 2d or 3d art that may be overlaid onto a polygon mesh to create a realistic 3D model.Texture artists often take advantage...

  • Texture filtering
    Texture filtering
    In computer graphics, texture filtering or texture smoothing is the method used to determine the texture color for a texture mapped pixel, using the colors of nearby texels . Mathematically, texture filtering is a type of anti-aliasing, but it filters out high frequencies from the texture fill...

  • Texture splatting
    Texture Splatting
    In computer graphics, texture splatting is a method for combining different textures. The method works by applying an alphamap to the higher levels, revealing the layers underneath where the alphamap is partially or completely transparent...

     – a technique for combining textures.
  • UV Mapping
    UV mapping
    UV mapping is the 3D modeling process of making a 2D image representation of a 3D model.-UV mapping:This process projects a texture map onto a 3D object...

  • UVW Mapping
  • Wrapping (graphics)
    Wrapping (graphics)
    In computer graphics, wrapping is the process of limiting a position to an area. A good example of wrapping is wallpaper, a single pattern repeated indefinitely over a wall...


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK