Texture-space
   HOME

TheInfoList



OR:

Texture mapping is a term used in
computer graphics Computer graphics deals with generating images and art with the aid of computers. Computer graphics is a core technology in digital photography, film, video games, digital art, cell phone and computer displays, and many specialized applications. ...
to describe how 2D images are projected onto 3D models. The most common variant is the UV unwrap, which can be described as an inverse paper cutout, where the surfaces of a 3D model are cut apart so that it can be unfolded into a 2D coordinate space (UV Space).


Semantic

Texture mapping can both refer to the task of unwrapping a 3D model, the abstract that a 3D model has textures applied to it and the related algorithm of the 3D software. Texture map refers to a
Raster graphics upright=1, The Smiley, smiley face in the top left corner is a raster image. When enlarged, individual pixels appear as squares. Enlarging further, each pixel can be analyzed, with their colors constructed through combination of the values for ...
also called image, texture. If the texture stores a specific property it's also referred to as color map, roughness map, etc. The coordinate space which converts from the 3D space of a 3D model into a 2D space so that it can sample from the Texture map is called: UV Space, UV Coordinates, Texture Space.


Algorithm

A simplified explanation of how an algorithm could work to render an image: # For each pixel we trace the coordinates of the screen into the 3D scene. # If we hit a 3D model, or more precisely the polygon of a 3D model we read the 2D UV coordinates. # We use the UV Coordinates to read the color from the texture and apply it to the pixel.


History

The original technique was pioneered by
Edwin Catmull Edwin Earl Catmull (born March 31, 1945) is an American computer scientist and animator who served as the co-founder of Pixar and the President of Walt Disney Animation Studios. He has been honored for his contributions to 3D computer graphics, ...
in 1974 as part of his doctoral thesis. Texture mapping originally referred to diffuse mapping, a method that simply mapped
pixel In digital imaging, a pixel (abbreviated px), pel, or picture element is the smallest addressable element in a Raster graphics, raster image, or the smallest addressable element in a dot matrix display device. In most digital display devices, p ...
s from a texture to a 3D surface ("wrapping" the image around the object). In recent decades, the advent of multi-pass rendering,
multitexturing Texture mapping is a term used in computer graphics to describe how 2D images are projected onto 3D models. The most common variant is the UV unwrap, which can be described as an inverse paper cutout, where the surfaces of a 3D model are cut ap ...
,
mipmap In computer graphics, a mipmap (''mip'' being an acronym of the Latin phrase ''multum in parvo'', meaning "much in little") is a pre-calculated, optimized sequence of images, each of which has an image resolution which is a factor of two small ...
s, and more complex mappings such as height mapping,
bump mapping Bump mapping is a texture mapping 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 calcul ...
,
normal mapping In 3D computer graphics, normal mapping, or Dot3 bump mapping, is a texture mapping technique used for faking the lighting of bumps and dents – an implementation of bump mapping. It is used to add details without using more polygonal modeling, ...
,
displacement mapping Displacement mapping is an alternative computer graphics technique in contrast to bump, normal, 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 ...
,
reflection mapping In computer graphics, reflection mapping or environment mapping is an efficient image-based lighting technique for approximating the appearance of a reflective surface by means of a precomputed texture. The texture is used to store the image o ...
, specular mapping, occlusion mapping, and many other variations on the technique (controlled by a materials system) have made it possible to simulate near-
photorealism Photorealism is a genre of art that encompasses painting, drawing and other graphic media, in which an artist studies a photograph and then attempts to reproduce the image as realistically as possible in another medium. Although the term can b ...
in real time by vastly reducing the number of
polygon In geometry, a polygon () is a plane figure made up of line segments connected to form a closed polygonal chain. The segments of a closed polygonal chain are called its '' edges'' or ''sides''. The points where two edges meet are the polygon ...
s and lighting calculations needed to construct a realistic and functional 3D scene.


Texture maps

A is an image applied (mapped) to the surface of a shape or
polygon In geometry, a polygon () is a plane figure made up of line segments connected to form a closed polygonal chain. The segments of a closed polygonal chain are called its '' edges'' or ''sides''. The points where two edges meet are the polygon ...
. This may be a
bitmap image In computing, a bitmap (also called raster) graphic is an image formed from rows of different colored pixels. A GIF is an example of a graphics image file that uses a bitmap. As a noun, the term "bitmap" is very often used to refer to a partic ...
or a
procedural texture In computer graphics, a procedural texture is a Image texture, texture created using a mathematical description (i.e. an algorithm) rather than directly stored data. The advantage of this approach is low storage cost, unlimited texture resolution ...
. They may be stored in common
image file formats An image file format is a file format for a digital image. There are many formats that can be used, such as JPEG, PNG, and GIF. Most formats up until 2022 were for storing 2D images, not 3D ones. The data stored in an image file format may be c ...
, referenced by 3D model formats or material definitions, and assembled into
resource bundles This is a list of file formats used by computers, organized by type. Filename extension is usually noted in parentheses if they differ from the file format's name or abbreviation. Many operating systems do not limit filenames to one extension s ...
. They may have one to three dimensions, although two dimensions are most common for visible surfaces. For use with modern hardware, texture map data may be stored in swizzled or tiled orderings to improve
cache coherency In computer architecture, cache coherence is the uniformity of shared resource data that is stored in multiple local caches. In a cache coherent system, if multiple clients have a cached copy of the same region of a shared memory resource, all ...
. Rendering APIs typically manage texture map resources (which may be located in device memory) as buffers or surfaces, and may allow ' render to texture' for additional effects such as post processing or
environment mapping In computer graphics, reflection mapping or environment mapping is an efficient image-based lighting technique for approximating the appearance of a reflective surface by means of a precomputed texture. The texture is used to store the image of ...
. They usually contain
RGB The RGB color model is an additive color model in which the red, green, and blue primary colors of light are added together in various ways to reproduce a broad array of colors. The name of the model comes from the initials of the three ...
color data (either stored as direct color, compressed formats, or
indexed color In computing, indexed color is a technique to manage digital images' colors in a limited fashion, in order to save computer computer data storage, memory and Hard disk drive, file storage, while speeding up display refresh and file transfers. It ...
), and sometimes an additional channel for
alpha blending In computer graphics, alpha compositing or alpha blending is the process of combining one image with a background to create the appearance of partial or full transparency. It is often useful to render picture elements (pixels) in separate pass ...
(
RGBA RGBA stands for red green blue alpha. While it is sometimes described as a color space, it is actually a three-channel RGB color model supplemented with a fourth ''alpha channel''. Alpha indicates how opaque each pixel is and allows an image to ...
) especially for
billboards A billboard (also called a hoarding in the UK and many other parts of the world) is a large out-of-home advertising, outdoor advertising structure (a billing board), typically found in high-traffic areas such as alongside busy roads. Billboard ...
and ''decal'' overlay textures. It is possible to use the
alpha channel In computer graphics, alpha compositing or alpha blending is the process of combining one image with a background to create the appearance of partial or full transparency. It is often useful to render picture elements (pixels) in separate pass ...
(which may be convenient to store in formats parsed by hardware) for other uses such as specularity. Multiple texture maps (or
channels Channel, channels, channeling, etc., may refer to: Geography * Channel (geography), a landform consisting of the outline (banks) of the path of a narrow body of water. Australia * Channel Country, region of outback Australia in Queensland and pa ...
) may be combined for control over specularity, normals,
displacement Displacement may refer to: Physical sciences Mathematics and physics *Displacement (geometry), is the difference between the final and initial position of a point trajectory (for instance, the center of mass of a moving object). The actual path ...
, or
subsurface scattering Subsurface scattering (SSS), also known as subsurface light transport (SSLT), is a mechanism of light transport in which light that penetrates the surface of a translucent object is scattering, scattered by interacting with the Material (comput ...
e.g. for skin rendering. Multiple texture images may be combined in texture atlases or array textures to reduce state changes for modern hardware. (They may be considered a modern evolution of tile map graphics). Modern hardware often supports
cube map A cube or regular hexahedron is a three-dimensional solid object in geometry, which is bounded by six congruent square faces, a type of polyhedron. It has twelve congruent edges and eight vertices. It is a type of parallelepiped, with pairs of pa ...
textures with multiple faces for environment mapping.


Creation

Texture maps may be acquired by scanning/
digital photography Digital photography uses cameras containing arrays of electronic photodetectors interfaced to an analog-to-digital converter (ADC) to produce images focused by a lens, as opposed to an exposure on photographic film. The digitized image is ...
, designed in image manipulation software such as
GIMP Gimp or GIMP may refer to: Clothing * Bondage suit, also called a gimp suit, a type of suit used in BDSM * Bondage mask, also called a gimp mask, often worn in conjunction with a gimp suit Embroidery and crafts * Gimp (thread), an ornamental tr ...
,
Photoshop Adobe Photoshop is a raster graphics editor developed and published by Adobe for Windows and macOS. It was created in 1987 by Thomas and John Knoll. It is the most used tool for professional digital art, especially in raster graphics editin ...
, or painted onto 3D surfaces directly in a 3D paint tool such as
Mudbox Mudbox is a proprietary computer-based 3D sculpting and painting tool. developed by Autodesk, Mudbox was created by Skymatter, founded by Tibor Madjar, David Cardwell and Andrew Camenisch, former artists of Weta Digital, where the tool was f ...
or ZBrush.


Texture application

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 UV coordinates). This may be done through explicit assignment of vertex attributes, manually edited in a 3D modelling package through UV unwrapping tools. It is also possible to associate a procedural transformation from 3D space to texture space with the
material A material is a matter, substance or mixture of substances that constitutes an Physical object, object. Materials can be pure or impure, living or non-living matter. Materials can be classified on the basis of their physical property, physical ...
. This might be accomplished via planar projection or, alternatively,
cylindrical A cylinder () has traditionally been a Solid geometry, three-dimensional solid, one of the most basic of curvilinear geometric shapes. In elementary geometry, it is considered a Prism (geometry), prism with a circle as its base. A cylinder may ...
or
spherical A sphere (from Ancient Greek, Greek , ) is a surface (mathematics), surface analogous to the circle, a curve. In solid geometry, a sphere is the Locus (mathematics), set of points that are all at the same distance from a given point in three ...
mapping. More complex mappings may consider the distance along a surface to minimize distortion. These coordinates are interpolated across the faces of polygons to sample the texture map during rendering. Textures may be repeated or mirrored to extend a finite rectangular bitmap over a larger area, or they may have a one-to-one unique "
injective In mathematics, an injective function (also known as injection, or one-to-one function ) is a function that maps distinct elements of its domain to distinct elements of its codomain; that is, implies (equivalently by contraposition, impl ...
" mapping from every piece of a surface (which is important for render mapping and light mapping, also known as
baking Baking is a method of preparing food that uses dry heat, typically in an oven, but it can also be done in hot ashes, or on hot Baking stone, stones. Bread is the most commonly baked item, but many other types of food can also be baked. Heat is ...
).


Texture space

Texture mapping maps the model surface (or
screen space This is a glossary of terms relating to computer graphics. For more general computer hardware terms, see glossary of computer hardware terms. 0–9 A B ...
during rasterization) into texture space; in this space, the texture map is visible in its undistorted form. UV unwrapping tools typically provide a view in texture space for manual editing of texture coordinates. Some rendering techniques such as
subsurface scattering Subsurface scattering (SSS), also known as subsurface light transport (SSLT), is a mechanism of light transport in which light that penetrates the surface of a translucent object is scattering, scattered by interacting with the Material (comput ...
may be performed approximately by texture-space operations.


Multitexturing

Multitexturing is the use of more than one texture at a time on a polygon. For instance, a
light map A lightmap is a data structure used in lightmapping, a form of surface caching in which the brightness of surfaces in a virtual scene is pre-calculated and stored in texture maps for later use. Lightmaps are most commonly applied to static o ...
texture may be used to light a surface as an alternative to recalculating that lighting every time the surface is rendered. Microtextures or detail textures are used to add higher frequency details, and dirt maps may add weathering and variation; this can greatly reduce the apparent periodicity of repeating textures. Modern graphics may use more than 10 layers, which are combined using
shaders In computer graphics, a shader is a computer program that calculates the appropriate levels of light, darkness, and color during the rendering of a 3D scene—a process known as '' shading''. Shaders have evolved to perform a variety of sp ...
, for greater fidelity. Another multitexture technique is
bump mapping Bump mapping is a texture mapping 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 calcul ...
, 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.


Texture filtering

The way that samples (e.g. when viewed as
pixel In digital imaging, a pixel (abbreviated px), pel, or picture element is the smallest addressable element in a Raster graphics, raster image, or the smallest addressable element in a dot matrix display device. In most digital display devices, p ...
s on the screen) are calculated from the
texel Texel (; Texels dialect: ) is a municipality and an island with a population of 13,643 in North Holland, Netherlands. It is the largest and most populated island of the West Frisian Islands in the Wadden Sea. The island is situated north of Den ...
s (texture pixels) is governed by
texture filtering In computer graphics, texture filtering or texture smoothing is the method used to determine the texture color for a Texture mapping, texture mapped pixel, using the colors of nearby Texel (graphics), texels (ie. pixels of the texture). Filtering ...
. The cheapest method is to use the nearest-neighbour interpolation, but
bilinear interpolation In mathematics, bilinear interpolation is a method for interpolating functions of two variables (e.g., ''x'' and ''y'') using repeated linear interpolation. It is usually applied to functions sampled on a 2D rectilinear grid, though it can be ge ...
or
trilinear interpolation Trilinear interpolation is a method of multivariate interpolation on a Three dimensional space, 3-dimensional regular grid. It approximates the value of a function at an intermediate point (x, y, z) within the local axial rectangular prism (geo ...
between
mipmap In computer graphics, a mipmap (''mip'' being an acronym of the Latin phrase ''multum in parvo'', meaning "much in little") is a pre-calculated, optimized sequence of images, each of which has an image resolution which is a factor of two small ...
s are two commonly used alternatives which reduce
aliasing In signal processing and related disciplines, aliasing is a phenomenon that a reconstructed signal from samples of the original signal contains low frequency components that are not present in the original one. This is caused when, in the ori ...
or
jaggies Jaggies are artifacts in raster images, most frequently from aliasing, which in turn is often caused by non-linear mixing effects producing high-frequency components, or missing or poor anti-aliasing filtering prior to sampling. Jaggies are stai ...
. In the event of a texture coordinate being outside the texture, it is either clamped or wrapped.
Anisotropic filtering In 3D computer graphics, anisotropic filtering (AF) is a technique that improves the appearance of Texture filtering, textures, especially on surfaces viewed at sharp Viewing angle, angles. It helps make textures look sharper and more detailed ...
better eliminates directional artefacts when viewing textures from oblique viewing angles.


Texture streaming

Texture streaming is a means of using
data stream In connection-oriented communication, a data stream is the transmission of a sequence of digitally encoded signals to convey information. Typically, the transmitted symbols are grouped into a series of packets. Data streaming has become u ...
s for textures, where each texture is available in two or more different resolutions, as to determine which texture should be loaded into memory and used based on draw distance from the viewer and how much memory is available for textures. Texture streaming allows a rendering engine to use low resolution textures for objects far away from the viewer's camera, and resolve those into more detailed textures, read from a data source, as the point of view nears the objects.


Baking

As an optimization, it is possible to render detail from a complex, high-resolution model or expensive process (such as
global illumination Global illumination (GI), or indirect illumination, is a group of algorithms used in 3D computer graphics that are meant to add more realistic lighting Lighting or illumination is the deliberate use of light to achieve practical or aest ...
) into a surface texture (possibly on a low-resolution model). ''Baking'' is also known as render mapping. This technique is most commonly used for light maps, but may also be used to generate normal maps and displacement maps. Some computer games (e.g.
Messiah In Abrahamic religions, a messiah or messias (; , ; , ; ) is a saviour or liberator of a group of people. The concepts of '' mashiach'', messianism, and of a Messianic Age originated in Judaism, and in the Hebrew Bible, in which a ''mashiach ...
) have used this technique. The original Quake software engine used on-the-fly baking to combine light maps and colour maps (" surface caching"). Baking can be used as a form of level of detail generation, where a complex scene with many different elements and materials may be approximated by a ''single'' element with a ''single'' texture, which is then algorithmically reduced for lower rendering cost and fewer drawcalls. It is also used to take high-detail models from 3D sculpting software and point cloud scanning and approximate them with meshes more suitable for realtime rendering.


Rasterisation algorithms

Various techniques have evolved in software and hardware implementations. Each offers different trade-offs in precision, versatility and performance.


Affine texture mapping

Affine texture mapping linearly interpolates texture coordinates across a surface, and so is the fastest form of texture mapping. Some software and hardware (such as the original
PlayStation is a video gaming brand owned and produced by Sony Interactive Entertainment (SIE), a division of Japanese conglomerate Sony. Its flagship products consists of a series of home video game consoles produced under the brand; it also consists ...
)
project A project is a type of assignment, typically involving research or design, that is carefully planned to achieve a specific objective. An alternative view sees a project managerially as a sequence of events: a "set of interrelated tasks to be ...
vertices in 3D space onto the screen during rendering and linearly interpolate the texture coordinates ''in screen space'' between them. This may be done by incrementing fixed point
UV coordinates UV mapping is the 3D modeling process of projecting a 3D model's surface to a 2D image for texture mapping. The letters "U" and "V" denote the axes of the 2D texture because "X", "Y", and "Z" are already used to denote the axes of the 3D object i ...
, or by an
incremental error algorithm This is a glossary of terms relating to computer graphics. For more general computer hardware terms, see glossary of computer hardware terms. 0–9 A B ...
akin to
Bresenham's line algorithm Bresenham's line algorithm is a line drawing algorithm that determines the points of an ''n''-dimensional raster that should be selected in order to form a close approximation to a straight line between two points. It is commonly used to draw li ...
. In contrast to perpendicular polygons, this leads to noticeable distortion with perspective transformations (see figure: the checker box texture appears bent), especially as primitives near the
camera A camera is an instrument used to capture and store images and videos, either digitally via an electronic image sensor, or chemically via a light-sensitive material such as photographic film. As a pivotal technology in the fields of photograp ...
. Such distortion may be reduced with the subdivision of the polygon into smaller ones. For the case of rectangular objects, using quad primitives can look less incorrect than the same rectangle split into triangles, but because interpolating 4 points adds complexity to the rasterization, most early implementations preferred triangles only. Some hardware, such as the forward texture mapping used by the Nvidia NV1, was able to offer efficient quad primitives. With perspective correction (see below) triangles become equivalent and this advantage disappears. For rectangular objects that are at right angles to the viewer, like floors and walls, the perspective only needs to be corrected in one direction across the screen, rather than both. The correct perspective mapping can be calculated at the left and right edges of the floor, and then an affine linear interpolation across that horizontal span will look correct, because every pixel along that line is the same distance from the viewer.


Perspective correctness

Perspective correct texturing accounts for the vertices' positions in 3D space, rather than simply interpolating coordinates in 2D screen space. This achieves the correct visual effect but it is more expensive to calculate. To perform perspective correction of the texture coordinates u and v, with z being the depth component from the viewer's point of view, we can take advantage of the fact that the values \frac, \frac, and \frac are linear in screen space across the surface being textured. In contrast, the original z, u and v, before the division, are not linear across the surface in screen space. We can therefore linearly interpolate these reciprocals across the surface, computing corrected values at each pixel, to result in a perspective correct texture mapping. To do this, we first calculate the reciprocals at each vertex of our geometry (3 points for a triangle). For vertex n we have \frac, \frac, \frac. Then, we linearly interpolate these reciprocals between the n vertices (e.g., using barycentric coordinates), resulting in interpolated values across the surface. At a given point, this yields the interpolated u_i, v_i, and zReciprocal_i = \frac. Note that this u_i, v_i cannot be yet used as our texture coordinates as our division by z altered their coordinate system. To correct back to the u, v space we first calculate the corrected z by again taking the reciprocal z_ = \frac = \frac. Then we use this to correct our u_i, v_i: u_ = u_i \cdot z_i and v_ = v_i \cdot z_i. 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 u^_ between two endpoints u^_0 and u^_1: ::u^_= (1 - \alpha ) u_0 + \alpha u_1 where 0 \le \alpha \le 1 :Perspective correct mapping interpolates after dividing by depth z^_, then uses its interpolated reciprocal to recover the correct coordinate: ::u^_= \frac 3D graphics hardware typically supports perspective correct texturing. Various techniques have evolved for rendering texture mapped geometry into images with different quality/precision trade-offs, which can be applied to both software and hardware. Classic software texture mappers generally did only simple mapping with at most one lighting effect (typically applied through a
lookup table In computer science, a lookup table (LUT) is an array data structure, array that replaces runtime (program lifecycle phase), runtime computation of a mathematical function (mathematics), function with a simpler array indexing operation, in a proc ...
), and the perspective correctness was about 16 times more expensive.


Restricted camera rotation

The ''
Doom engine id Tech 1, also known as the ''Doom'' engine, is the game engine used in the id Software video games '' Doom'' and '' Doom II: Hell on Earth''. It is also used in ''Heretic'', '' Hexen: Beyond Heretic'', '' Strife: Quest for the Sigil'', '' Hacx ...
'' restricted the world to vertical walls and horizontal floors/ceilings, with a camera that could only rotate about the vertical axis. This meant the walls would be a constant depth coordinate along a vertical line and the floors/ceilings would have a constant depth along a horizontal line. After performing one perspective correction calculation for the depth, the rest of the line could use fast affine mapping. Some later renderers of this era simulated a small amount of camera pitch with
shearing Sheep shearing is the process by which the woollen fleece of a sheep is cut off. The person who removes the sheep's wool is called a '' shearer''. Typically each adult sheep is shorn once each year (depending upon dialect, a sheep may be sai ...
which allowed the appearance of greater freedom whilst using the same rendering technique. Some engines were able to render texture mapped
heightmaps In computer graphics, a heightmap or heightfield is a raster image used mainly as Discrete Global Grid in secondary elevation modeling. Each pixel stores values, such as surface elevation data, for display in 3D computer graphics. A height ...
(e.g.
Nova Logic NovaLogic, Inc. was an American software developer and publisher established in 1985 and based in Calabasas, California. The company was founded by CEO John A. Garcia. Garcia's background in computer software started in Southern California in th ...
's Voxel Space, and the engine for Outcast) via Bresenham-like incremental algorithms, producing the appearance of a texture mapped landscape without the use of traditional geometric primitives.


Subdivision for perspective correction

Every triangle can be further subdivided into groups of about 16 pixels in order to achieve two goals. First, keeping the arithmetic mill busy at all times. Second, producing faster arithmetic results.


World space subdivision

For perspective texture mapping without hardware support, a triangle is broken down into smaller triangles for rendering and affine mapping is used on them. The reason this technique works is that the distortion of affine mapping becomes much less noticeable on smaller polygons. The
Sony PlayStation is a Video game, video gaming brand owned and produced by Sony Interactive Entertainment (SIE), a division of Japanese conglomerate Sony. Its flagship products consists of a series of Home video game console, home video game consoles produce ...
made extensive use of this because it only supported affine mapping in hardware but had a relatively high triangle throughput compared to its peers.


Screen space subdivision

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 x86 (also known as 80x86 or the 8086 family) is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel, based on the 8086 microprocessor and its 8-bit-external-bus variant, the 8088. Th ...
CPU; the
68000 The Motorola 68000 (sometimes shortened to Motorola 68k or m68k and usually pronounced "sixty-eight-thousand") is a 16/32-bit complex instruction set computer (CISC) microprocessor, introduced in 1979 by Motorola Semiconductor Products Sector ...
or any
RISC In electronics and computer science, a reduced instruction set computer (RISC) is a computer architecture designed to simplify the individual instructions given to the computer to accomplish tasks. Compared to the instructions given to a comp ...
is much more suited). 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.


Other techniques

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, the Build engine extended the constant distance trick used for Doom by finding the line of constant distance for arbitrary polygons and rendering along it.


Hardware implementations

Texture mapping hardware was originally developed for simulation (e.g. as implemented in the Evans and Sutherland ESIG and Singer-Link Digital Image Generators DIG), and professional graphics workstations such as
Silicon Graphics Silicon Graphics, Inc. (stylized as SiliconGraphics before 1999, later rebranded SGI, historically known as Silicon Graphics Computer Systems or SGCS) was an American high-performance computing manufacturer, producing computer hardware and soft ...
, broadcast
digital video effect Digital video effects (DVEs) are visual effects that provide comprehensive live video image manipulation, in the same form as optical printer effects in film. DVEs differ from standard video switcher effects (often referred to as ''analog effects ...
s machines such as the Ampex ADO and later appeared in
Arcade cabinet An arcade cabinet, also known as an arcade machine or a coin-op cabinet or coin-op machine, is the housing within which an arcade game's electronic hardware resides. Most cabinets designed since the mid-1980s conform to the Japanese Amusement Ma ...
s, consumer
video game console A video game console is an electronic device that Input/output, outputs a video signal or image to display a video game that can typically be played with a game controller. These may be home video game console, home consoles, which are generally ...
s, and PC
video card A graphics card (also called a video card, display card, graphics accelerator, graphics adapter, VGA card/VGA, video adapter, display adapter, or colloquially GPU) is a computer expansion card that generates a feed of graphics output to a displa ...
s in the mid-1990s. In flight simulation, texture mapping provided important motion and altitude cues necessary for pilot training not available on untextured surfaces. It was also in flight simulation applications, that texture mapping was implemented for real-time processing with prefiltered texture patterns stored in memory for real-time access by the video processor. Modern
graphics processing unit A graphics processing unit (GPU) is a specialized electronic circuit designed for digital image processing and to accelerate computer graphics, being present either as a discrete video card or embedded on motherboards, mobile phones, personal ...
s (GPUs) provide specialised fixed function units called ''texture samplers'', or ''texture mapping units'', to perform texture mapping, usually with
trilinear filtering Trilinear filtering is an extension of the bilinear texture filtering method, which also performs linear interpolation between mipmaps. Bilinear filtering has several weaknesses that make it an unattractive choice in many cases: using it on a ...
or better multi-tap
anisotropic filtering In 3D computer graphics, anisotropic filtering (AF) is a technique that improves the appearance of Texture filtering, textures, especially on surfaces viewed at sharp Viewing angle, angles. It helps make textures look sharper and more detailed ...
and hardware for decoding specific formats such as DXTn. As of 2016, texture mapping hardware is ubiquitous as most SOCs contain a suitable GPU. Some hardware combines texture mapping with
hidden-surface determination In 3D computer graphics, hidden-surface determination (also known as shown-surface determination, hidden-surface removal (HSR), occlusion culling (OC) or visible-surface determination (VSD)) is the process of identifying what Computer representat ...
in tile based deferred rendering or
scanline rendering Scanline rendering (also scan line rendering and scan-line rendering) is an algorithm for visible surface determination, in 3D computer graphics, that works on a row-by-row basis rather than a polygon-by-polygon or pixel-by-pixel basis. All of ...
; such systems only fetch the visible
texels In Computer graphics, computer graphics, a texel, texture element, or texture pixel is the fundamental unit of a texture maps, texture map. Textures are represented by Array (data structure), arrays of texels representing the texture space, just ...
at the expense of using greater workspace for transformed vertices. Most systems have settled on the
Z-buffering A z-buffer, also known as a depth buffer, is a type of data buffer used in computer graphics to store the depth information of fragments. The values stored represent the distance to the camera, with 0 being the closest. The encoding scheme may ...
approach, which can still reduce the texture mapping workload with front-to-back
sorting Sorting refers to ordering data in an increasing or decreasing manner according to some linear relationship among the data items. # ordering: arranging items in a sequence ordered by some criterion; # categorizing: grouping items with similar p ...
. Among earlier graphics hardware, there were two competing paradigms of how to deliver a texture to the screen: * Forward texture mapping iterates through each texel on the texture, and decides where to place it on the screen. * Inverse texture mapping instead iterates through pixels on the screen, and decides what texel to use for each. Inverse texture mapping is the method which has become standard in modern hardware.


Inverse texture mapping

With this method, a pixel on the screen is mapped to a point on the texture. Each vertex of a rendering primitive is projected to a point on the screen, and each of these points is mapped to a u,v texel coordinate on the texture. A rasterizer will interpolate between these points to fill in each pixel covered by the primitive. The primary advantage is that each pixel covered by a primitive will be traversed exactly once. Once a primitive's vertices are transformed, the amount of remaining work scales directly with how many pixels it covers on the screen. The main disadvantage versus forward texture mapping is that the
memory access pattern In computing, a memory access pattern or IO access pattern is the pattern with which a system or program reads and writes memory on secondary storage. These patterns differ in the level of locality of reference and drastically affect cache perform ...
in the
texture space Texture mapping is a term used in computer graphics to describe how 2D images are projected onto 3D models. The most common variant is the UV unwrap, which can be described as an inverse paper cutout, where the surfaces of a 3D model are cut ap ...
will not be linear if the texture is at an angle to the screen. This disadvantage is often addressed by texture caching techniques, such as the swizzled texture memory arrangement. The linear interpolation can be used directly for simple and efficient
affine Affine may describe any of various topics concerned with connections or affinities. It may refer to: * Affine, a Affinity_(law)#Terminology, relative by marriage in law and anthropology * Affine cipher, a special case of the more general substi ...
texture mapping, but can also be adapted for perspective correctness.


Forward texture mapping

Forward texture mapping maps each texel of the texture to a pixel on the screen. After transforming a rectangular primitive to a place on the screen, a forward texture mapping renderer iterates through each texel on the texture, splatting each one onto a pixel of the
frame buffer A framebuffer (frame buffer, or sometimes framestore) is a portion of random-access memory (RAM) containing a bitmap that drives a video display. It is a memory buffer containing data representing all the pixels in a complete video frame. Mode ...
. This was used by some hardware, such as the 3DO, the
Sega Saturn The is a home video game console developed by Sega and released on November 22, 1994, in Japan, May 11, 1995, in North America, and July 8, 1995, in Europe. Part of the fifth generation of video game consoles, it is the successor to the succes ...
and the NV1. The primary advantage is that the texture will be accessed in a simple linear order, allowing very efficient caching of the texture data. However, this benefit is also its disadvantage: as a primitive gets smaller on screen, it still has to iterate over every texel in the texture, causing many pixels to be overdrawn redundantly. This method is also well suited for rendering quad primitives rather than reducing them to triangles, which provided an advantage when perspective correct texturing was not available in hardware. This is because the affine distortion of a quad looks less incorrect than the same quad split into two triangles (see affine texture mapping above). The NV1 hardware also allowed a quadratic interpolation mode to provide an even better approximation of perspective correctness. The existing hardware implementations did not provide effective UV coordinate mapping, which became an important technique for 3D modelling and assisted in
clipping Clipping may refer to: Words * Clipping (morphology), the formation of a new word by shortening it, e.g. "ad" from "advertisement" * Clipping (phonetics), shortening the articulation of a speech sound, usually a vowel * Clipping (publications ...
the texture correctly when the primitive goes over the edge of the screen. These shortcomings could have been addressed with further development, but GPU design has since mostly moved toward inverse mapping.


Applications

Beyond 3D rendering, the availability of texture mapping hardware has inspired its use for accelerating other tasks:


Tomography

It is possible to use texture mapping hardware to accelerate both the
reconstruction Reconstruction may refer to: Politics, history, and sociology *Reconstruction (law), the transfer of a company's (or several companies') business to a new company *''Perestroika'' (Russian for "reconstruction"), a late 20th century Soviet Union ...
of
voxel In computing, a voxel is a representation of a value on a three-dimensional regular grid, akin to the two-dimensional pixel. Voxels are frequently used in the Data visualization, visualization and analysis of medical imaging, medical and scient ...
data sets from tomographic scans, and to visualize the results.


User interfaces

Many user interfaces use texture mapping to accelerate animated transitions of screen elements, e.g. Exposé in
Mac OS X macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
.


See also

* 2.5D *
3D computer graphics 3D computer graphics, sometimes called Computer-generated imagery, CGI, 3D-CGI or three-dimensional Computer-generated imagery, computer graphics, are graphics that use a three-dimensional representation of geometric data (often Cartesian coor ...
*
Mipmap In computer graphics, a mipmap (''mip'' being an acronym of the Latin phrase ''multum in parvo'', meaning "much in little") is a pre-calculated, optimized sequence of images, each of which has an image resolution which is a factor of two small ...
* Materials system * Parametrization * Texture synthesis *
Texture atlas In computer graphics, a texture atlas (also called a spritesheet or an image sprite in 2D game development) is an image containing multiple smaller images, usually packed together to reduce overall dimensions. An atlas can consist of uniformly-siz ...
*
Texture splatting In computer graphics, texture splatting is a method for combining different textures. It works by applying an alphamap (also called a "weightmap" or a "splat map") to the higher levels, thereby revealing the layers underneath where the alphamap i ...
– a technique for combining textures *
Shader (computer graphics) In computer graphics, a shader is a computer program that calculates the appropriate levels of light, darkness, and color during the rendering of a 3D scene—a process known as '' shading''. Shaders have evolved to perform a variety of sp ...


References


Software


TexRecon
— open-source software for texturing 3D models written in C++


External links


Introduction into texture mapping using C and SDL
(PDF)
Programming a textured terrain
using XNA/DirectX, from www.riemers.net


Time Texturing
Texture mapping with bezier lines
Polynomial Texture Mapping
Interactive Relighting for Photos

Methods that can be used to interpolate a texture knowing the texture coords at the vertices of a polygon
3D Texturing Tools
{{DEFAULTSORT:Texture Mapping Computer graphics