text
stringlengths
0
473k
[SOURCE: https://en.wikipedia.org/wiki/StopFake] | [TOKENS: 1339]
Contents StopFake The StopFake website is a project of Ukrainian media NGO Media Reforms Center. It was founded in March 2014 by Ukrainian professors and students with the stated purpose of refuting Russian propaganda and fake news. It began as a Russian- and English-language fact-checking organization, and has grown to include a TV show broadcast on 30 local channels, a weekly radio show, and a strong social media following. StopFake was founded as a volunteer effort, but by 2017 included paid employees on its team. It is largely funded by grants. It has received praise from other media outlets. In 2014 it received a BOBs award from Deutsche Welle and a Free Media Pioneer Award from the International Press Institute. History The organization grew out of an online discussion between faculty and alumni of National University of Kyiv-Mohyla Academy. Margot Gontar (at that point a recent master's graduate of the Mohyla journalism program), Oleg Shankovskyi, Ruslan Deynychenko, and Yevhen Fedchenko (a professor of journalism at Mohyla Academy) co-founded the organization in 2014. The website StopFake.org went live on 2 March 2014. It was founded shortly after the invasion and annexation of Crimea by Russia. In its first four months of operation, its website averaged one and a half million visitors per month. In November 2016, the organization became a partner in the First Draft News network. Operation StopFake opposes the spread of disinformation by Russia, focusing on information disseminated on social media. including through the use of digital tools. It produces StopFake News, a weekly television show hosted by co-founder Gontar only about fake news, and holds the standard that "[i]f fact checkers cannot prove that a story published or broadcast by another news media outlet is false, it will not be featured in the weekly airing". Following the allegations of Russian influence in the 2016 United States presidential election, StopFake began to gain international recognition. The site has been financed by crowdfunding, readers' contributions, the Renaissance Foundation, National Endowment for Democracy, National Democratic Institute, German Marshall Fund, the Foreign Ministry of the Czech Republic, the Foreign Ministry of the United Kingdom, the British Embassy in Ukraine, and the Sigrid Rausing Trust. In 2022 Fortune described it as operating on a "shoestring budget". StopFake started as a volunteer effort, but it had 26 paid staff members by 2017. CBS News reported in February 2022 that it was run by volunteers and journalism students. In April 2022 The Washington Post reported that it had 15 employees. In July 2020, StopFake signed an agreement with National TV and Radio Council on cooperation in monitoring and analyzing disinformation. StopFake is also a third-party fact checker for Facebook. Stopfake is part of the International Fact-Checking Network, run by the Poynter Institute, which sets editorial standards for fact-checking organisations. Reception Olga Yurkova, the founder and editor of StopFake, was included in the 2016 New Europe 100 list chosen by the Financial Times, Google, Res Publica and Visegrád Group. The list recognises central and eastern Europe's brightest and best people. StopFake won the "Best Project in Russian Award" in Deutsche Welle's 2014 BOBs awards. The New York Times wrote in 2017 that StopFake "is highly respected in journalistic circles here in Kyiv, the Ukrainian capital, for its specialty of debunking fake news", and it "reported some of the biggest nonstories of the war" in Ukraine. Also in 2017, Politico stated that "the journalism school crew behind StopFake have emerged as the 'grand wizards' of the fake-news-busting world". Freedom House described it as a "gold standard" in exposing fake news, said that its work has become "a model in other Central and Eastern European countries". In 2020, The New York Times reported that despite its commitment to neutral fact-checking, as per Facebook's policy, StopFake was accused of bias in its work. In 2020, the Zaborona website published a report, co-authored by Ukrainian journalist Ekaterina Sergatskova [uk], which accused StopFake of having links with Ukrainian far-right and neo-Nazi groups, such as S14. The report included that Marko Suprun, host of StopFake's English-language video program, had been shown in social media photographs at a gathering with two musicians from Holocaust-denying white power band Sokyra Peruna [uk] and another controversial band Komu Vnyz. The report also stated that the director and founder of StopFake, Yevhen Fedchenko, had tweeted in defence of S14 on one occasion, spoken against freedom of the press and supported the website Myrotvorets. Following this Sergatskova was subjected to online harassment from commentators and hard right figures, including death threats and posting of her personal information, and she left Kyiv, reporting fears for her life. The threats were condemned by StopFake. StopFake said the accusations in the article were untrue, calling the Zaborona article a part of a campaign of slanderous "information attacks" against the project team. StopFake said that the use of the photographs to allege far-right connections were employing "guilt by association". StopFake has subsequently signed a statement by media workers calling for a defence of Sergatskova from death threats. Ukrainian Foreign Minister Dmytro Kuleba supported StopFake, saying that his ministry observed co-ordinated, systematic attempts by Russia to undermine the reputation of the fact-checking project. The Media Reforms Center complained to Ukraine's Independent Media Council (IMC) about Zaborona. IMC ruled that the Zaborona story violated three principles of the journalistic code of ethics and "groundlessly and biasedly discredits the StopFake project as a fact-checker, misleading the readers about the mechanism of interaction between the fact-checkers and Facebook". During the 2022 Russian invasion of Ukraine, StopFake received attention for its role in combating disinformation. Fortune described it as a "vital force" in protecting Ukraine's efforts against propaganda and disinformation. In 2022, StopFake was one of seven Ukrainian outlets that was awarded the Free Media Pioneer award by the International Press Institute and the Library of Congress announced it would digitally archive the website as a record of Russian propaganda during the war. References External links
========================================
[SOURCE: https://en.wikipedia.org/wiki/Texture_mapping#Algorithm] | [TOKENS: 4408]
Contents Texture mapping 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 apart so that it can be unfolded into a 2D coordinate space (UV space). Semantic Texture mapping can multiply refer to (1) the task of unwrapping a 3D model (converting the surface of a 3D model into a 2D texture map), (2) applying a 2D texture map onto the surface of a 3D model, and (3) the 3D software algorithm that performs both tasks. A texture map refers to a 2D image ("texture") that adds visual detail to a 3D model. The image can be stored as a raster graphic. A texture that stores a specific property—such as bumpiness, reflectivity, or transparency—is also referred to as a color map or roughness map. The coordinate space that converts from a 3D model's 3D space into a 2D space for sampling from the texture map is variously called UV space, UV coordinates, or texture space. Algorithm The following is a simplified explanation of how an algorithm could work to render an image: History The original technique was pioneered by Edwin Catmull in 1974 as part of his doctoral thesis. Texture mapping originally referred to diffuse mapping, a method that simply mapped pixels from a texture to a 3D surface ("wrapping" the image around the object). In recent decades, the advent of multi-pass rendering, multitexturing, mipmaps, and more complex mappings such as height mapping, bump mapping, normal mapping, displacement mapping, reflection mapping, specular mapping, occlusion mapping, and many other variations on the technique (controlled by a materials system) have made it possible to simulate near-photorealism in real time by vastly reducing the number of polygons and lighting calculations needed to construct a realistic and functional 3D scene. Texture maps A texture map is an image applied ("mapped") to the surface of a shape or polygon. This may be a bitmap image or a procedural texture. They may be stored in common image file formats, referenced by 3D model formats or material definitions, and assembled into resource bundles. 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. 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. Texture maps usually contain RGB color data (either stored as direct color, compressed formats, or indexed color), and sometimes an additional channel for alpha blending (RGBA) especially for billboards and decal overlay textures. It is possible to use the alpha channel (which may be convenient to store in formats parsed by hardware) for other uses such as specularity. Multiple texture maps (or channels) may be combined for control over specularity, normals, displacement, or subsurface scattering, 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 textures with multiple faces for environment mapping. Texture maps may be acquired by scanning or digital photography, designed in image manipulation software such as GIMP or Photoshop, or painted onto 3D surfaces directly in a 3D paint tool such as Mudbox or ZBrush. 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. This might be accomplished via planar projection or, alternatively, cylindrical or spherical 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" mapping from every piece of a surface (which is important for render mapping and light mapping, also known as baking). Texture mapping maps the model surface (or screen space 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 may be performed approximately by texture-space operations. Multitexturing is the use of more than one texture at a time on a polygon. For instance, a light map 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 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, for greater fidelity. Another multitexture technique is bump mapping, 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 video games, as graphics hardware has become powerful enough to accommodate it in real-time. The way that samples (e.g. when viewed as pixels on the screen) are calculated from the texels (texture pixels) is governed by texture filtering. The cheapest method is to use the nearest-neighbour interpolation, but bilinear interpolation or trilinear interpolation between mipmaps are two commonly used alternatives which reduce aliasing or jaggies. In the event of a texture coordinate being outside the texture, it is either clamped or wrapped. Anisotropic filtering better eliminates directional artefacts when viewing textures from oblique viewing angles. Texture streaming is a means of using data streams 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. As an optimization, it is possible to render detail from a complex, high-resolution model or expensive process (such as global illumination) into a surface texture (possibly on a low-resolution model). This technique is called baking (or render mapping) and 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) have used this technique. The original Quake software engine used on-the-fly baking to combine light maps and colour maps in a process called 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 linearly interpolates texture coordinates across a surface, making it the fastest form of texture mapping. Some software and hardware (such as the original PlayStation) project 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 or by an incremental error algorithm akin to Bresenham's line algorithm. In contrast to perpendicular polygons, this leads to noticeable distortion with perspective transformations (as shown in the figure: the checker box texture appears bent), especially as primitives near the camera. This distortion can be reduced by subdividing polygons into smaller polygons. Using quad primitives for rectangular objects can look less incorrect than if those rectangles were split into triangles. However, since interpolating four 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, offered efficient quad primitives. With perspective correction, triangles become equivalent to quad primitives 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. Affine linear interpolation across that horizontal span will look correct because every pixel along that line is the same distance from the viewer. Perspective correct texturing accounts for the vertices' positions in 3D space rather than simply interpolating coordinates in 2D screen space. While achieving the correct visual effect, perspective correct texturing is more expensive to calculate. To perform perspective correction of the texture coordinates u {\displaystyle u} and v {\displaystyle v} , with z {\displaystyle z} being the depth component from the viewer's point of view, it is possible to take advantage of the fact that the values 1 z {\displaystyle {\frac {1}{z}}} , u z {\displaystyle {\frac {u}{z}}} , and v z {\displaystyle {\frac {v}{z}}} are linear in screen space across the surface being textured. In contrast, the original z {\displaystyle z} , u {\displaystyle u} , and v {\displaystyle v} , before the division, are not linear across the surface in screen space. It is therefore possible to linearly interpolate these reciprocals across the surface, computing corrected values at each pixel, to produce a perspective correct texture mapping. To do this, the reciprocals at each vertex of the geometry (three points for a triangle) are calculated. Vertex n {\displaystyle n} has reciprocals u n z n {\displaystyle {\frac {u_{n}}{z_{n}}}} , v n z n {\displaystyle {\frac {v_{n}}{z_{n}}}} , and 1 z n {\displaystyle {\frac {1}{z_{n}}}} . Then, linear interpolation can be done on these reciprocals between the n {\displaystyle 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 {\displaystyle u_{i},v_{i}} and 1 z i {\displaystyle {\frac {1}{z_{i}}}} (reciprocal z i {\displaystyle z_{i}} ). However, as our division by z {\displaystyle z} altered their coordinate system, this u i , v i {\displaystyle u_{i},v_{i}} cannot be used as texture coordinates. To correct back to the u , v {\displaystyle u,v} space, the corrected z {\displaystyle z} is calculated by taking the reciprocal once again: z c o r r e c t = 1 1 z i {\displaystyle z_{correct}={\frac {1}{\frac {1}{z_{i}}}}} . This is then used to correct the u i , v i {\displaystyle u_{i},v_{i}} coordinates: u c o r r e c t = u i ⋅ z i {\displaystyle u_{correct}=u_{i}\cdot z_{i}} and v c o r r e c t = v i ⋅ z i {\displaystyle v_{correct}=v_{i}\cdot z_{i}} . This correction makes it so that the difference from pixel to pixel between texture coordinates is smaller in parts of the polygon that are closer to the viewer (stretching the texture wider) and is larger in parts that are farther away (compressing the texture). Affine texture mapping directly interpolates a texture coordinate u α {\displaystyle u_{\alpha }} between two endpoints u 0 {\displaystyle u_{0}} and u 1 {\displaystyle u_{1}} : u α = ( 1 − α ) u 0 + α u 1 {\displaystyle u_{\alpha }=(1-\alpha )u_{0}+\alpha u_{1}} where 0 ≤ α ≤ 1 {\displaystyle 0\leq \alpha \leq 1} . Perspective correct mapping interpolates after dividing by depth z {\displaystyle z} , then uses its interpolated reciprocal to recover the correct coordinate: u α = ( 1 − α ) u 0 z 0 + α u 1 z 1 ( 1 − α ) 1 z 0 + α 1 z 1 {\displaystyle u_{\alpha }={\frac {(1-\alpha ){\frac {u_{0}}{z_{0}}}+\alpha {\frac {u_{1}}{z_{1}}}}{(1-\alpha ){\frac {1}{z_{0}}}+\alpha {\frac {1}{z_{1}}}}}} 3D graphics hardware typically supports perspective correct texturing. Various techniques have evolved for rendering texture mapped geometry into images with different quality and precision trade-offs, which can be applied to both software and hardware. Classic software texture mappers generally only performed simple texture mapping with one lighting effect at most (typically applied through a lookup table), and the perspective correctness was about 16 times more expensive.[compared to?] The Doom engine restricted the world to vertical walls and horizontal floors and 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 and 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 which allowed the appearance of greater freedom while using the same rendering technique. Some engines were able to render texture mapped heightmaps (e.g. Nova Logic'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. Every triangle can be further subdivided into groups of about 16 pixels in order to achieve two goals: keeping the arithmetic mill busy at all times and producing faster arithmetic results.[vague] 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 made extensive use of this because it only supported affine mapping in hardware and had a relatively high triangle throughput compared to its peers. Software renderers generally prefer 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), thus lessening the overhead further. Another reason is that affine texture mapping does not fit into the low number of CPU registers of the x86 CPU; the 68000 and RISC processors are much more suited for that approach. 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. As the polygons are rendered independently, 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.[original research?] One other technique is to approximate the perspective with a faster calculation, such as a polynomial. A second uses the 1 z i {\textstyle {\frac {1}{z_{i}}}} value of the last two drawn pixels to linearly extrapolate the next value. For the latter, the division is then done starting from those values so that all that has to be divided is a small remainder. However, the amount of bookkeeping needed makes this technique too slow on most systems.[citation needed] A third technique, used by the Build Engine (used, most notably, in Duke Nukem 3D), builds on the constant distance trick used by the Doom engine by finding and rendering along the line of constant distance for arbitrary polygons. 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) and broadcast digital video effects machines such as the Ampex ADO. Texture mapping hardware later appeared in arcade cabinets, consumer video game consoles, and PC video cards in the mid-1990s. In flight simulations, texture mapping provided important motion and altitude cues necessary for pilot training not available on untextured surfaces. Additionally, texture mapping was implemented so that real-time processing of prefiltered texture patterns stored in memory could be accessed by the video processor in real-time. Modern graphics processing units (GPUs) provide specialised fixed function units called texture samplers, or texture mapping units, to perform texture mapping, usually with trilinear filtering or better multi-tap anisotropic filtering 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 implementations combine texture mapping with hidden-surface determination in tile-based deferred rendering or scanline rendering; such systems only fetch the visible texels at the expense of using greater workspace for transformed vertices. Most systems have settled on the z-buffering approach, which can still reduce the texture mapping workload with front-to-back sorting. On earlier graphics hardware, there were two competing paradigms of how to deliver a texture to the screen: Of these methods, inverse texture mapping has become standard in modern hardware. 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 of this method 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 is that the memory access pattern in the texture space 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 texture mapping, but can also be adapted for perspective correctness. 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. This was used by some hardware, such as the 3DO, the Sega Saturn 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 the § Affine texture mapping section above). The NV1 hardware also allowed a quadratic interpolation mode to provide an even better approximation of perspective correctness. UV mapping became an important technique for 3D modelling and assisted in clipping the texture correctly when the primitive went past the edge of the screen, but existing hardware did not provide effective implementations of this. These shortcomings could have been addressed with further development, but GPU design has mostly shifted toward using the inverse mapping technique. Applications Beyond 3D rendering, the availability of texture mapping hardware has inspired its use for accelerating other tasks: It is possible to use texture mapping hardware to accelerate both the reconstruction of voxel data sets from tomographic scans, and to visualize the results. Many user interfaces use texture mapping to accelerate animated transitions of screen elements, e.g. Exposé in Mac OS X. See also References Software External links
========================================
[SOURCE: https://en.wikipedia.org/wiki/Category:Use_dmy_dates_from_October_2020] | [TOKENS: 144]
Category:Use dmy dates from October 2020 Wikipedia articles (tagged in this month) that use dd mm yyyy date formats, whether by application of the first main contributor rule or by virtue of close national ties to the subject belong in this category. Use {{Use dmy dates}} to add an article to this category. See MOS:DATE. This system of tagging or categorisation is used as a status monitor of all articles that use dd mm yyyy date formats, and not as a clean up. Pages in category "Use dmy dates from October 2020" The following 200 pages are in this category, out of approximately 16,884 total. This list may not reflect recent changes.
========================================
[SOURCE: https://en.wikipedia.org/wiki/Texture_mapping#Texture_space] | [TOKENS: 4408]
Contents Texture mapping 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 apart so that it can be unfolded into a 2D coordinate space (UV space). Semantic Texture mapping can multiply refer to (1) the task of unwrapping a 3D model (converting the surface of a 3D model into a 2D texture map), (2) applying a 2D texture map onto the surface of a 3D model, and (3) the 3D software algorithm that performs both tasks. A texture map refers to a 2D image ("texture") that adds visual detail to a 3D model. The image can be stored as a raster graphic. A texture that stores a specific property—such as bumpiness, reflectivity, or transparency—is also referred to as a color map or roughness map. The coordinate space that converts from a 3D model's 3D space into a 2D space for sampling from the texture map is variously called UV space, UV coordinates, or texture space. Algorithm The following is a simplified explanation of how an algorithm could work to render an image: History The original technique was pioneered by Edwin Catmull in 1974 as part of his doctoral thesis. Texture mapping originally referred to diffuse mapping, a method that simply mapped pixels from a texture to a 3D surface ("wrapping" the image around the object). In recent decades, the advent of multi-pass rendering, multitexturing, mipmaps, and more complex mappings such as height mapping, bump mapping, normal mapping, displacement mapping, reflection mapping, specular mapping, occlusion mapping, and many other variations on the technique (controlled by a materials system) have made it possible to simulate near-photorealism in real time by vastly reducing the number of polygons and lighting calculations needed to construct a realistic and functional 3D scene. Texture maps A texture map is an image applied ("mapped") to the surface of a shape or polygon. This may be a bitmap image or a procedural texture. They may be stored in common image file formats, referenced by 3D model formats or material definitions, and assembled into resource bundles. 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. 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. Texture maps usually contain RGB color data (either stored as direct color, compressed formats, or indexed color), and sometimes an additional channel for alpha blending (RGBA) especially for billboards and decal overlay textures. It is possible to use the alpha channel (which may be convenient to store in formats parsed by hardware) for other uses such as specularity. Multiple texture maps (or channels) may be combined for control over specularity, normals, displacement, or subsurface scattering, 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 textures with multiple faces for environment mapping. Texture maps may be acquired by scanning or digital photography, designed in image manipulation software such as GIMP or Photoshop, or painted onto 3D surfaces directly in a 3D paint tool such as Mudbox or ZBrush. 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. This might be accomplished via planar projection or, alternatively, cylindrical or spherical 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" mapping from every piece of a surface (which is important for render mapping and light mapping, also known as baking). Texture mapping maps the model surface (or screen space 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 may be performed approximately by texture-space operations. Multitexturing is the use of more than one texture at a time on a polygon. For instance, a light map 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 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, for greater fidelity. Another multitexture technique is bump mapping, 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 video games, as graphics hardware has become powerful enough to accommodate it in real-time. The way that samples (e.g. when viewed as pixels on the screen) are calculated from the texels (texture pixels) is governed by texture filtering. The cheapest method is to use the nearest-neighbour interpolation, but bilinear interpolation or trilinear interpolation between mipmaps are two commonly used alternatives which reduce aliasing or jaggies. In the event of a texture coordinate being outside the texture, it is either clamped or wrapped. Anisotropic filtering better eliminates directional artefacts when viewing textures from oblique viewing angles. Texture streaming is a means of using data streams 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. As an optimization, it is possible to render detail from a complex, high-resolution model or expensive process (such as global illumination) into a surface texture (possibly on a low-resolution model). This technique is called baking (or render mapping) and 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) have used this technique. The original Quake software engine used on-the-fly baking to combine light maps and colour maps in a process called 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 linearly interpolates texture coordinates across a surface, making it the fastest form of texture mapping. Some software and hardware (such as the original PlayStation) project 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 or by an incremental error algorithm akin to Bresenham's line algorithm. In contrast to perpendicular polygons, this leads to noticeable distortion with perspective transformations (as shown in the figure: the checker box texture appears bent), especially as primitives near the camera. This distortion can be reduced by subdividing polygons into smaller polygons. Using quad primitives for rectangular objects can look less incorrect than if those rectangles were split into triangles. However, since interpolating four 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, offered efficient quad primitives. With perspective correction, triangles become equivalent to quad primitives 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. Affine linear interpolation across that horizontal span will look correct because every pixel along that line is the same distance from the viewer. Perspective correct texturing accounts for the vertices' positions in 3D space rather than simply interpolating coordinates in 2D screen space. While achieving the correct visual effect, perspective correct texturing is more expensive to calculate. To perform perspective correction of the texture coordinates u {\displaystyle u} and v {\displaystyle v} , with z {\displaystyle z} being the depth component from the viewer's point of view, it is possible to take advantage of the fact that the values 1 z {\displaystyle {\frac {1}{z}}} , u z {\displaystyle {\frac {u}{z}}} , and v z {\displaystyle {\frac {v}{z}}} are linear in screen space across the surface being textured. In contrast, the original z {\displaystyle z} , u {\displaystyle u} , and v {\displaystyle v} , before the division, are not linear across the surface in screen space. It is therefore possible to linearly interpolate these reciprocals across the surface, computing corrected values at each pixel, to produce a perspective correct texture mapping. To do this, the reciprocals at each vertex of the geometry (three points for a triangle) are calculated. Vertex n {\displaystyle n} has reciprocals u n z n {\displaystyle {\frac {u_{n}}{z_{n}}}} , v n z n {\displaystyle {\frac {v_{n}}{z_{n}}}} , and 1 z n {\displaystyle {\frac {1}{z_{n}}}} . Then, linear interpolation can be done on these reciprocals between the n {\displaystyle 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 {\displaystyle u_{i},v_{i}} and 1 z i {\displaystyle {\frac {1}{z_{i}}}} (reciprocal z i {\displaystyle z_{i}} ). However, as our division by z {\displaystyle z} altered their coordinate system, this u i , v i {\displaystyle u_{i},v_{i}} cannot be used as texture coordinates. To correct back to the u , v {\displaystyle u,v} space, the corrected z {\displaystyle z} is calculated by taking the reciprocal once again: z c o r r e c t = 1 1 z i {\displaystyle z_{correct}={\frac {1}{\frac {1}{z_{i}}}}} . This is then used to correct the u i , v i {\displaystyle u_{i},v_{i}} coordinates: u c o r r e c t = u i ⋅ z i {\displaystyle u_{correct}=u_{i}\cdot z_{i}} and v c o r r e c t = v i ⋅ z i {\displaystyle v_{correct}=v_{i}\cdot z_{i}} . This correction makes it so that the difference from pixel to pixel between texture coordinates is smaller in parts of the polygon that are closer to the viewer (stretching the texture wider) and is larger in parts that are farther away (compressing the texture). Affine texture mapping directly interpolates a texture coordinate u α {\displaystyle u_{\alpha }} between two endpoints u 0 {\displaystyle u_{0}} and u 1 {\displaystyle u_{1}} : u α = ( 1 − α ) u 0 + α u 1 {\displaystyle u_{\alpha }=(1-\alpha )u_{0}+\alpha u_{1}} where 0 ≤ α ≤ 1 {\displaystyle 0\leq \alpha \leq 1} . Perspective correct mapping interpolates after dividing by depth z {\displaystyle z} , then uses its interpolated reciprocal to recover the correct coordinate: u α = ( 1 − α ) u 0 z 0 + α u 1 z 1 ( 1 − α ) 1 z 0 + α 1 z 1 {\displaystyle u_{\alpha }={\frac {(1-\alpha ){\frac {u_{0}}{z_{0}}}+\alpha {\frac {u_{1}}{z_{1}}}}{(1-\alpha ){\frac {1}{z_{0}}}+\alpha {\frac {1}{z_{1}}}}}} 3D graphics hardware typically supports perspective correct texturing. Various techniques have evolved for rendering texture mapped geometry into images with different quality and precision trade-offs, which can be applied to both software and hardware. Classic software texture mappers generally only performed simple texture mapping with one lighting effect at most (typically applied through a lookup table), and the perspective correctness was about 16 times more expensive.[compared to?] The Doom engine restricted the world to vertical walls and horizontal floors and 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 and 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 which allowed the appearance of greater freedom while using the same rendering technique. Some engines were able to render texture mapped heightmaps (e.g. Nova Logic'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. Every triangle can be further subdivided into groups of about 16 pixels in order to achieve two goals: keeping the arithmetic mill busy at all times and producing faster arithmetic results.[vague] 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 made extensive use of this because it only supported affine mapping in hardware and had a relatively high triangle throughput compared to its peers. Software renderers generally prefer 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), thus lessening the overhead further. Another reason is that affine texture mapping does not fit into the low number of CPU registers of the x86 CPU; the 68000 and RISC processors are much more suited for that approach. 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. As the polygons are rendered independently, 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.[original research?] One other technique is to approximate the perspective with a faster calculation, such as a polynomial. A second uses the 1 z i {\textstyle {\frac {1}{z_{i}}}} value of the last two drawn pixels to linearly extrapolate the next value. For the latter, the division is then done starting from those values so that all that has to be divided is a small remainder. However, the amount of bookkeeping needed makes this technique too slow on most systems.[citation needed] A third technique, used by the Build Engine (used, most notably, in Duke Nukem 3D), builds on the constant distance trick used by the Doom engine by finding and rendering along the line of constant distance for arbitrary polygons. 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) and broadcast digital video effects machines such as the Ampex ADO. Texture mapping hardware later appeared in arcade cabinets, consumer video game consoles, and PC video cards in the mid-1990s. In flight simulations, texture mapping provided important motion and altitude cues necessary for pilot training not available on untextured surfaces. Additionally, texture mapping was implemented so that real-time processing of prefiltered texture patterns stored in memory could be accessed by the video processor in real-time. Modern graphics processing units (GPUs) provide specialised fixed function units called texture samplers, or texture mapping units, to perform texture mapping, usually with trilinear filtering or better multi-tap anisotropic filtering 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 implementations combine texture mapping with hidden-surface determination in tile-based deferred rendering or scanline rendering; such systems only fetch the visible texels at the expense of using greater workspace for transformed vertices. Most systems have settled on the z-buffering approach, which can still reduce the texture mapping workload with front-to-back sorting. On earlier graphics hardware, there were two competing paradigms of how to deliver a texture to the screen: Of these methods, inverse texture mapping has become standard in modern hardware. 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 of this method 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 is that the memory access pattern in the texture space 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 texture mapping, but can also be adapted for perspective correctness. 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. This was used by some hardware, such as the 3DO, the Sega Saturn 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 the § Affine texture mapping section above). The NV1 hardware also allowed a quadratic interpolation mode to provide an even better approximation of perspective correctness. UV mapping became an important technique for 3D modelling and assisted in clipping the texture correctly when the primitive went past the edge of the screen, but existing hardware did not provide effective implementations of this. These shortcomings could have been addressed with further development, but GPU design has mostly shifted toward using the inverse mapping technique. Applications Beyond 3D rendering, the availability of texture mapping hardware has inspired its use for accelerating other tasks: It is possible to use texture mapping hardware to accelerate both the reconstruction of voxel data sets from tomographic scans, and to visualize the results. Many user interfaces use texture mapping to accelerate animated transitions of screen elements, e.g. Exposé in Mac OS X. See also References Software External links
========================================
[SOURCE: https://en.wikipedia.org/wiki/Wikipedia:WikiProject_COVID-19] | [TOKENS: 988]
Contents Wikipedia:WikiProject COVID-19 WikiProject COVID-19 is a WikiProject dedicated to Wikipedia's coverage of the SARS-CoV-2 virus, COVID-19, and the COVID-19 pandemic. Please join us! The project is an offshoot of WikiProject Disaster management, WikiProject Medicine (including the Pulmonology and Society and medicine task forces), and WikiProject Viruses. Sibling projects include WikiProject AIDS. Content As of 21 February 2026, there are 2,513 articles within the scope of WikiProject COVID-19. Including non-article pages, such as talk pages, redirects, categories, project pages, etcetera, there are 5,026 pages in the project. Select [►] to view all reader oriented content about COVID-19 Select [►] to view just subcategories Select [►] to view all templates {{COVID-19 pandemic}} contains English Wikipedia's main portfolio of articles related to COVID-19 as seen below. For the sidebar used on many articles see {{COVID-19 pandemic sidebar}} Content assessments are used within the project itself as a quality and importance scale that aid in identifying vital content, while recognizing excellent contributions and pages in need of further work and cleanup. An automated listing of the project's recognized content. This includes FA and GA content and nominations alongside articles, images, "In the news", and "Did you know .." content featured on our main page. As of 21 February 2026, there are 2 featured and 18 good content items within WikiProject COVID-19 scope. This makes up 0.02% of all featured content and 0.04% of all good articles. Resources Generally accepted standards that editors should attempt to follow. Current events contains a listing on an automated basis of importance news reports and related articles. Maintenance Help with assessment process and identify new articles which do not meet the criteria for inclusion and/or to "tag" them for any glaring issues that need attention. Most critical are copyright violations and defamatory material about living persons, followed closely by pages that are deliberately misleading; while identifying editors who seek to exploit our readers for financial gain. Article Alerts is an automated listing of Deletion talks, Requests for Comments, Featured article candidates, Did you know nominations, etc...related to COVID-19 content that requires your input! See also; Wikipedia:WikiProject Deletion sorting/COVID-19. clean-up listing for COVID-19 The clean-up listing contains articles needing attention - including problems with page layout, spelling, grammar, technical errors, POV, neutrality and sourcing concerns (assuming the cleanup templates were placed correctly). These are the articles that have been edited the most within the last three days. Last updated 27 August 2025 by HotArticlesBot. Task forces Task forces allow for the organization and devoted talk pages for various specialized areas of interest. Project pages Select [►] to view all WikiProject COVID-19 project pages or Sanctions and consensus notices Pages relating to the coronavirus are currently subject to active discretionary sanctions. In general, editors who repeatedly or seriously fail to edit in accordance with the purpose of Wikipedia, the expected standards of behaviour, or any normal editorial process may be sanctioned by any uninvolved administrator. {{Ds/editnotice|Restriction|topic=covid}} These templates can be used on talk pages to alert editors that consensus has been formed on certain points of interest related to all (or a subset of) COVID-19 articles. The major benefit of such templates is the avoidance of repeated discussions on contentious topics, especially from new or infrequent editors. {{Current COVID-19 Project Consensus}} (expanded by default, but collapsible with the parameter: |collapsed=yes) WikiProject COVID-19 aims to add to and build consensus for pages relating to COVID-19. They have so far discussed items listed below. Please discuss proposed improvements to them at the project talk page. General Page title Map To ensure you are viewing the current list, you may wish to purge this page. {{Origins of COVID-19 (current consensus)}} Origins of COVID-19: Current consensus {{COVID-19 treatments (current consensus)}} Treatments for COVID-19: Current consensus A note on WP:MEDRS: Per this Wikipedia policy, we must rely on the highest quality secondary sources and the recommendations of professional organizations and government bodies when determining the scientific consensus about medical treatments. Participants Anyone may join, including YOU! Internal coverage of Wikipedia's efforts The symposium on Wikipedia and COVID-19 hosted by Wikimedia New York City on May 9 answered questions the public and press may have about Wikipedia's coverage of the pandemic. Featured speakers included User:Netha Hussain, User:Another Believer, User:TMorata, and User:Bluerasberry. External links The following Wikimedia Foundation sister projects provide more on this subject:
========================================
[SOURCE: https://en.wikipedia.org/wiki/Texture_mapping#Texture_streaming] | [TOKENS: 4408]
Contents Texture mapping 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 apart so that it can be unfolded into a 2D coordinate space (UV space). Semantic Texture mapping can multiply refer to (1) the task of unwrapping a 3D model (converting the surface of a 3D model into a 2D texture map), (2) applying a 2D texture map onto the surface of a 3D model, and (3) the 3D software algorithm that performs both tasks. A texture map refers to a 2D image ("texture") that adds visual detail to a 3D model. The image can be stored as a raster graphic. A texture that stores a specific property—such as bumpiness, reflectivity, or transparency—is also referred to as a color map or roughness map. The coordinate space that converts from a 3D model's 3D space into a 2D space for sampling from the texture map is variously called UV space, UV coordinates, or texture space. Algorithm The following is a simplified explanation of how an algorithm could work to render an image: History The original technique was pioneered by Edwin Catmull in 1974 as part of his doctoral thesis. Texture mapping originally referred to diffuse mapping, a method that simply mapped pixels from a texture to a 3D surface ("wrapping" the image around the object). In recent decades, the advent of multi-pass rendering, multitexturing, mipmaps, and more complex mappings such as height mapping, bump mapping, normal mapping, displacement mapping, reflection mapping, specular mapping, occlusion mapping, and many other variations on the technique (controlled by a materials system) have made it possible to simulate near-photorealism in real time by vastly reducing the number of polygons and lighting calculations needed to construct a realistic and functional 3D scene. Texture maps A texture map is an image applied ("mapped") to the surface of a shape or polygon. This may be a bitmap image or a procedural texture. They may be stored in common image file formats, referenced by 3D model formats or material definitions, and assembled into resource bundles. 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. 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. Texture maps usually contain RGB color data (either stored as direct color, compressed formats, or indexed color), and sometimes an additional channel for alpha blending (RGBA) especially for billboards and decal overlay textures. It is possible to use the alpha channel (which may be convenient to store in formats parsed by hardware) for other uses such as specularity. Multiple texture maps (or channels) may be combined for control over specularity, normals, displacement, or subsurface scattering, 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 textures with multiple faces for environment mapping. Texture maps may be acquired by scanning or digital photography, designed in image manipulation software such as GIMP or Photoshop, or painted onto 3D surfaces directly in a 3D paint tool such as Mudbox or ZBrush. 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. This might be accomplished via planar projection or, alternatively, cylindrical or spherical 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" mapping from every piece of a surface (which is important for render mapping and light mapping, also known as baking). Texture mapping maps the model surface (or screen space 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 may be performed approximately by texture-space operations. Multitexturing is the use of more than one texture at a time on a polygon. For instance, a light map 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 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, for greater fidelity. Another multitexture technique is bump mapping, 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 video games, as graphics hardware has become powerful enough to accommodate it in real-time. The way that samples (e.g. when viewed as pixels on the screen) are calculated from the texels (texture pixels) is governed by texture filtering. The cheapest method is to use the nearest-neighbour interpolation, but bilinear interpolation or trilinear interpolation between mipmaps are two commonly used alternatives which reduce aliasing or jaggies. In the event of a texture coordinate being outside the texture, it is either clamped or wrapped. Anisotropic filtering better eliminates directional artefacts when viewing textures from oblique viewing angles. Texture streaming is a means of using data streams 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. As an optimization, it is possible to render detail from a complex, high-resolution model or expensive process (such as global illumination) into a surface texture (possibly on a low-resolution model). This technique is called baking (or render mapping) and 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) have used this technique. The original Quake software engine used on-the-fly baking to combine light maps and colour maps in a process called 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 linearly interpolates texture coordinates across a surface, making it the fastest form of texture mapping. Some software and hardware (such as the original PlayStation) project 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 or by an incremental error algorithm akin to Bresenham's line algorithm. In contrast to perpendicular polygons, this leads to noticeable distortion with perspective transformations (as shown in the figure: the checker box texture appears bent), especially as primitives near the camera. This distortion can be reduced by subdividing polygons into smaller polygons. Using quad primitives for rectangular objects can look less incorrect than if those rectangles were split into triangles. However, since interpolating four 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, offered efficient quad primitives. With perspective correction, triangles become equivalent to quad primitives 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. Affine linear interpolation across that horizontal span will look correct because every pixel along that line is the same distance from the viewer. Perspective correct texturing accounts for the vertices' positions in 3D space rather than simply interpolating coordinates in 2D screen space. While achieving the correct visual effect, perspective correct texturing is more expensive to calculate. To perform perspective correction of the texture coordinates u {\displaystyle u} and v {\displaystyle v} , with z {\displaystyle z} being the depth component from the viewer's point of view, it is possible to take advantage of the fact that the values 1 z {\displaystyle {\frac {1}{z}}} , u z {\displaystyle {\frac {u}{z}}} , and v z {\displaystyle {\frac {v}{z}}} are linear in screen space across the surface being textured. In contrast, the original z {\displaystyle z} , u {\displaystyle u} , and v {\displaystyle v} , before the division, are not linear across the surface in screen space. It is therefore possible to linearly interpolate these reciprocals across the surface, computing corrected values at each pixel, to produce a perspective correct texture mapping. To do this, the reciprocals at each vertex of the geometry (three points for a triangle) are calculated. Vertex n {\displaystyle n} has reciprocals u n z n {\displaystyle {\frac {u_{n}}{z_{n}}}} , v n z n {\displaystyle {\frac {v_{n}}{z_{n}}}} , and 1 z n {\displaystyle {\frac {1}{z_{n}}}} . Then, linear interpolation can be done on these reciprocals between the n {\displaystyle 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 {\displaystyle u_{i},v_{i}} and 1 z i {\displaystyle {\frac {1}{z_{i}}}} (reciprocal z i {\displaystyle z_{i}} ). However, as our division by z {\displaystyle z} altered their coordinate system, this u i , v i {\displaystyle u_{i},v_{i}} cannot be used as texture coordinates. To correct back to the u , v {\displaystyle u,v} space, the corrected z {\displaystyle z} is calculated by taking the reciprocal once again: z c o r r e c t = 1 1 z i {\displaystyle z_{correct}={\frac {1}{\frac {1}{z_{i}}}}} . This is then used to correct the u i , v i {\displaystyle u_{i},v_{i}} coordinates: u c o r r e c t = u i ⋅ z i {\displaystyle u_{correct}=u_{i}\cdot z_{i}} and v c o r r e c t = v i ⋅ z i {\displaystyle v_{correct}=v_{i}\cdot z_{i}} . This correction makes it so that the difference from pixel to pixel between texture coordinates is smaller in parts of the polygon that are closer to the viewer (stretching the texture wider) and is larger in parts that are farther away (compressing the texture). Affine texture mapping directly interpolates a texture coordinate u α {\displaystyle u_{\alpha }} between two endpoints u 0 {\displaystyle u_{0}} and u 1 {\displaystyle u_{1}} : u α = ( 1 − α ) u 0 + α u 1 {\displaystyle u_{\alpha }=(1-\alpha )u_{0}+\alpha u_{1}} where 0 ≤ α ≤ 1 {\displaystyle 0\leq \alpha \leq 1} . Perspective correct mapping interpolates after dividing by depth z {\displaystyle z} , then uses its interpolated reciprocal to recover the correct coordinate: u α = ( 1 − α ) u 0 z 0 + α u 1 z 1 ( 1 − α ) 1 z 0 + α 1 z 1 {\displaystyle u_{\alpha }={\frac {(1-\alpha ){\frac {u_{0}}{z_{0}}}+\alpha {\frac {u_{1}}{z_{1}}}}{(1-\alpha ){\frac {1}{z_{0}}}+\alpha {\frac {1}{z_{1}}}}}} 3D graphics hardware typically supports perspective correct texturing. Various techniques have evolved for rendering texture mapped geometry into images with different quality and precision trade-offs, which can be applied to both software and hardware. Classic software texture mappers generally only performed simple texture mapping with one lighting effect at most (typically applied through a lookup table), and the perspective correctness was about 16 times more expensive.[compared to?] The Doom engine restricted the world to vertical walls and horizontal floors and 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 and 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 which allowed the appearance of greater freedom while using the same rendering technique. Some engines were able to render texture mapped heightmaps (e.g. Nova Logic'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. Every triangle can be further subdivided into groups of about 16 pixels in order to achieve two goals: keeping the arithmetic mill busy at all times and producing faster arithmetic results.[vague] 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 made extensive use of this because it only supported affine mapping in hardware and had a relatively high triangle throughput compared to its peers. Software renderers generally prefer 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), thus lessening the overhead further. Another reason is that affine texture mapping does not fit into the low number of CPU registers of the x86 CPU; the 68000 and RISC processors are much more suited for that approach. 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. As the polygons are rendered independently, 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.[original research?] One other technique is to approximate the perspective with a faster calculation, such as a polynomial. A second uses the 1 z i {\textstyle {\frac {1}{z_{i}}}} value of the last two drawn pixels to linearly extrapolate the next value. For the latter, the division is then done starting from those values so that all that has to be divided is a small remainder. However, the amount of bookkeeping needed makes this technique too slow on most systems.[citation needed] A third technique, used by the Build Engine (used, most notably, in Duke Nukem 3D), builds on the constant distance trick used by the Doom engine by finding and rendering along the line of constant distance for arbitrary polygons. 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) and broadcast digital video effects machines such as the Ampex ADO. Texture mapping hardware later appeared in arcade cabinets, consumer video game consoles, and PC video cards in the mid-1990s. In flight simulations, texture mapping provided important motion and altitude cues necessary for pilot training not available on untextured surfaces. Additionally, texture mapping was implemented so that real-time processing of prefiltered texture patterns stored in memory could be accessed by the video processor in real-time. Modern graphics processing units (GPUs) provide specialised fixed function units called texture samplers, or texture mapping units, to perform texture mapping, usually with trilinear filtering or better multi-tap anisotropic filtering 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 implementations combine texture mapping with hidden-surface determination in tile-based deferred rendering or scanline rendering; such systems only fetch the visible texels at the expense of using greater workspace for transformed vertices. Most systems have settled on the z-buffering approach, which can still reduce the texture mapping workload with front-to-back sorting. On earlier graphics hardware, there were two competing paradigms of how to deliver a texture to the screen: Of these methods, inverse texture mapping has become standard in modern hardware. 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 of this method 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 is that the memory access pattern in the texture space 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 texture mapping, but can also be adapted for perspective correctness. 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. This was used by some hardware, such as the 3DO, the Sega Saturn 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 the § Affine texture mapping section above). The NV1 hardware also allowed a quadratic interpolation mode to provide an even better approximation of perspective correctness. UV mapping became an important technique for 3D modelling and assisted in clipping the texture correctly when the primitive went past the edge of the screen, but existing hardware did not provide effective implementations of this. These shortcomings could have been addressed with further development, but GPU design has mostly shifted toward using the inverse mapping technique. Applications Beyond 3D rendering, the availability of texture mapping hardware has inspired its use for accelerating other tasks: It is possible to use texture mapping hardware to accelerate both the reconstruction of voxel data sets from tomographic scans, and to visualize the results. Many user interfaces use texture mapping to accelerate animated transitions of screen elements, e.g. Exposé in Mac OS X. See also References Software External links
========================================
[SOURCE: https://en.wikipedia.org/wiki/Texture_mapping#Rasterisation_algorithms] | [TOKENS: 4408]
Contents Texture mapping 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 apart so that it can be unfolded into a 2D coordinate space (UV space). Semantic Texture mapping can multiply refer to (1) the task of unwrapping a 3D model (converting the surface of a 3D model into a 2D texture map), (2) applying a 2D texture map onto the surface of a 3D model, and (3) the 3D software algorithm that performs both tasks. A texture map refers to a 2D image ("texture") that adds visual detail to a 3D model. The image can be stored as a raster graphic. A texture that stores a specific property—such as bumpiness, reflectivity, or transparency—is also referred to as a color map or roughness map. The coordinate space that converts from a 3D model's 3D space into a 2D space for sampling from the texture map is variously called UV space, UV coordinates, or texture space. Algorithm The following is a simplified explanation of how an algorithm could work to render an image: History The original technique was pioneered by Edwin Catmull in 1974 as part of his doctoral thesis. Texture mapping originally referred to diffuse mapping, a method that simply mapped pixels from a texture to a 3D surface ("wrapping" the image around the object). In recent decades, the advent of multi-pass rendering, multitexturing, mipmaps, and more complex mappings such as height mapping, bump mapping, normal mapping, displacement mapping, reflection mapping, specular mapping, occlusion mapping, and many other variations on the technique (controlled by a materials system) have made it possible to simulate near-photorealism in real time by vastly reducing the number of polygons and lighting calculations needed to construct a realistic and functional 3D scene. Texture maps A texture map is an image applied ("mapped") to the surface of a shape or polygon. This may be a bitmap image or a procedural texture. They may be stored in common image file formats, referenced by 3D model formats or material definitions, and assembled into resource bundles. 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. 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. Texture maps usually contain RGB color data (either stored as direct color, compressed formats, or indexed color), and sometimes an additional channel for alpha blending (RGBA) especially for billboards and decal overlay textures. It is possible to use the alpha channel (which may be convenient to store in formats parsed by hardware) for other uses such as specularity. Multiple texture maps (or channels) may be combined for control over specularity, normals, displacement, or subsurface scattering, 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 textures with multiple faces for environment mapping. Texture maps may be acquired by scanning or digital photography, designed in image manipulation software such as GIMP or Photoshop, or painted onto 3D surfaces directly in a 3D paint tool such as Mudbox or ZBrush. 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. This might be accomplished via planar projection or, alternatively, cylindrical or spherical 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" mapping from every piece of a surface (which is important for render mapping and light mapping, also known as baking). Texture mapping maps the model surface (or screen space 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 may be performed approximately by texture-space operations. Multitexturing is the use of more than one texture at a time on a polygon. For instance, a light map 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 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, for greater fidelity. Another multitexture technique is bump mapping, 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 video games, as graphics hardware has become powerful enough to accommodate it in real-time. The way that samples (e.g. when viewed as pixels on the screen) are calculated from the texels (texture pixels) is governed by texture filtering. The cheapest method is to use the nearest-neighbour interpolation, but bilinear interpolation or trilinear interpolation between mipmaps are two commonly used alternatives which reduce aliasing or jaggies. In the event of a texture coordinate being outside the texture, it is either clamped or wrapped. Anisotropic filtering better eliminates directional artefacts when viewing textures from oblique viewing angles. Texture streaming is a means of using data streams 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. As an optimization, it is possible to render detail from a complex, high-resolution model or expensive process (such as global illumination) into a surface texture (possibly on a low-resolution model). This technique is called baking (or render mapping) and 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) have used this technique. The original Quake software engine used on-the-fly baking to combine light maps and colour maps in a process called 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 linearly interpolates texture coordinates across a surface, making it the fastest form of texture mapping. Some software and hardware (such as the original PlayStation) project 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 or by an incremental error algorithm akin to Bresenham's line algorithm. In contrast to perpendicular polygons, this leads to noticeable distortion with perspective transformations (as shown in the figure: the checker box texture appears bent), especially as primitives near the camera. This distortion can be reduced by subdividing polygons into smaller polygons. Using quad primitives for rectangular objects can look less incorrect than if those rectangles were split into triangles. However, since interpolating four 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, offered efficient quad primitives. With perspective correction, triangles become equivalent to quad primitives 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. Affine linear interpolation across that horizontal span will look correct because every pixel along that line is the same distance from the viewer. Perspective correct texturing accounts for the vertices' positions in 3D space rather than simply interpolating coordinates in 2D screen space. While achieving the correct visual effect, perspective correct texturing is more expensive to calculate. To perform perspective correction of the texture coordinates u {\displaystyle u} and v {\displaystyle v} , with z {\displaystyle z} being the depth component from the viewer's point of view, it is possible to take advantage of the fact that the values 1 z {\displaystyle {\frac {1}{z}}} , u z {\displaystyle {\frac {u}{z}}} , and v z {\displaystyle {\frac {v}{z}}} are linear in screen space across the surface being textured. In contrast, the original z {\displaystyle z} , u {\displaystyle u} , and v {\displaystyle v} , before the division, are not linear across the surface in screen space. It is therefore possible to linearly interpolate these reciprocals across the surface, computing corrected values at each pixel, to produce a perspective correct texture mapping. To do this, the reciprocals at each vertex of the geometry (three points for a triangle) are calculated. Vertex n {\displaystyle n} has reciprocals u n z n {\displaystyle {\frac {u_{n}}{z_{n}}}} , v n z n {\displaystyle {\frac {v_{n}}{z_{n}}}} , and 1 z n {\displaystyle {\frac {1}{z_{n}}}} . Then, linear interpolation can be done on these reciprocals between the n {\displaystyle 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 {\displaystyle u_{i},v_{i}} and 1 z i {\displaystyle {\frac {1}{z_{i}}}} (reciprocal z i {\displaystyle z_{i}} ). However, as our division by z {\displaystyle z} altered their coordinate system, this u i , v i {\displaystyle u_{i},v_{i}} cannot be used as texture coordinates. To correct back to the u , v {\displaystyle u,v} space, the corrected z {\displaystyle z} is calculated by taking the reciprocal once again: z c o r r e c t = 1 1 z i {\displaystyle z_{correct}={\frac {1}{\frac {1}{z_{i}}}}} . This is then used to correct the u i , v i {\displaystyle u_{i},v_{i}} coordinates: u c o r r e c t = u i ⋅ z i {\displaystyle u_{correct}=u_{i}\cdot z_{i}} and v c o r r e c t = v i ⋅ z i {\displaystyle v_{correct}=v_{i}\cdot z_{i}} . This correction makes it so that the difference from pixel to pixel between texture coordinates is smaller in parts of the polygon that are closer to the viewer (stretching the texture wider) and is larger in parts that are farther away (compressing the texture). Affine texture mapping directly interpolates a texture coordinate u α {\displaystyle u_{\alpha }} between two endpoints u 0 {\displaystyle u_{0}} and u 1 {\displaystyle u_{1}} : u α = ( 1 − α ) u 0 + α u 1 {\displaystyle u_{\alpha }=(1-\alpha )u_{0}+\alpha u_{1}} where 0 ≤ α ≤ 1 {\displaystyle 0\leq \alpha \leq 1} . Perspective correct mapping interpolates after dividing by depth z {\displaystyle z} , then uses its interpolated reciprocal to recover the correct coordinate: u α = ( 1 − α ) u 0 z 0 + α u 1 z 1 ( 1 − α ) 1 z 0 + α 1 z 1 {\displaystyle u_{\alpha }={\frac {(1-\alpha ){\frac {u_{0}}{z_{0}}}+\alpha {\frac {u_{1}}{z_{1}}}}{(1-\alpha ){\frac {1}{z_{0}}}+\alpha {\frac {1}{z_{1}}}}}} 3D graphics hardware typically supports perspective correct texturing. Various techniques have evolved for rendering texture mapped geometry into images with different quality and precision trade-offs, which can be applied to both software and hardware. Classic software texture mappers generally only performed simple texture mapping with one lighting effect at most (typically applied through a lookup table), and the perspective correctness was about 16 times more expensive.[compared to?] The Doom engine restricted the world to vertical walls and horizontal floors and 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 and 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 which allowed the appearance of greater freedom while using the same rendering technique. Some engines were able to render texture mapped heightmaps (e.g. Nova Logic'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. Every triangle can be further subdivided into groups of about 16 pixels in order to achieve two goals: keeping the arithmetic mill busy at all times and producing faster arithmetic results.[vague] 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 made extensive use of this because it only supported affine mapping in hardware and had a relatively high triangle throughput compared to its peers. Software renderers generally prefer 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), thus lessening the overhead further. Another reason is that affine texture mapping does not fit into the low number of CPU registers of the x86 CPU; the 68000 and RISC processors are much more suited for that approach. 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. As the polygons are rendered independently, 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.[original research?] One other technique is to approximate the perspective with a faster calculation, such as a polynomial. A second uses the 1 z i {\textstyle {\frac {1}{z_{i}}}} value of the last two drawn pixels to linearly extrapolate the next value. For the latter, the division is then done starting from those values so that all that has to be divided is a small remainder. However, the amount of bookkeeping needed makes this technique too slow on most systems.[citation needed] A third technique, used by the Build Engine (used, most notably, in Duke Nukem 3D), builds on the constant distance trick used by the Doom engine by finding and rendering along the line of constant distance for arbitrary polygons. 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) and broadcast digital video effects machines such as the Ampex ADO. Texture mapping hardware later appeared in arcade cabinets, consumer video game consoles, and PC video cards in the mid-1990s. In flight simulations, texture mapping provided important motion and altitude cues necessary for pilot training not available on untextured surfaces. Additionally, texture mapping was implemented so that real-time processing of prefiltered texture patterns stored in memory could be accessed by the video processor in real-time. Modern graphics processing units (GPUs) provide specialised fixed function units called texture samplers, or texture mapping units, to perform texture mapping, usually with trilinear filtering or better multi-tap anisotropic filtering 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 implementations combine texture mapping with hidden-surface determination in tile-based deferred rendering or scanline rendering; such systems only fetch the visible texels at the expense of using greater workspace for transformed vertices. Most systems have settled on the z-buffering approach, which can still reduce the texture mapping workload with front-to-back sorting. On earlier graphics hardware, there were two competing paradigms of how to deliver a texture to the screen: Of these methods, inverse texture mapping has become standard in modern hardware. 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 of this method 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 is that the memory access pattern in the texture space 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 texture mapping, but can also be adapted for perspective correctness. 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. This was used by some hardware, such as the 3DO, the Sega Saturn 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 the § Affine texture mapping section above). The NV1 hardware also allowed a quadratic interpolation mode to provide an even better approximation of perspective correctness. UV mapping became an important technique for 3D modelling and assisted in clipping the texture correctly when the primitive went past the edge of the screen, but existing hardware did not provide effective implementations of this. These shortcomings could have been addressed with further development, but GPU design has mostly shifted toward using the inverse mapping technique. Applications Beyond 3D rendering, the availability of texture mapping hardware has inspired its use for accelerating other tasks: It is possible to use texture mapping hardware to accelerate both the reconstruction of voxel data sets from tomographic scans, and to visualize the results. Many user interfaces use texture mapping to accelerate animated transitions of screen elements, e.g. Exposé in Mac OS X. See also References Software External links
========================================
[SOURCE: https://en.wikipedia.org/wiki/Texture_mapping#Restricted_camera_rotation] | [TOKENS: 4408]
Contents Texture mapping 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 apart so that it can be unfolded into a 2D coordinate space (UV space). Semantic Texture mapping can multiply refer to (1) the task of unwrapping a 3D model (converting the surface of a 3D model into a 2D texture map), (2) applying a 2D texture map onto the surface of a 3D model, and (3) the 3D software algorithm that performs both tasks. A texture map refers to a 2D image ("texture") that adds visual detail to a 3D model. The image can be stored as a raster graphic. A texture that stores a specific property—such as bumpiness, reflectivity, or transparency—is also referred to as a color map or roughness map. The coordinate space that converts from a 3D model's 3D space into a 2D space for sampling from the texture map is variously called UV space, UV coordinates, or texture space. Algorithm The following is a simplified explanation of how an algorithm could work to render an image: History The original technique was pioneered by Edwin Catmull in 1974 as part of his doctoral thesis. Texture mapping originally referred to diffuse mapping, a method that simply mapped pixels from a texture to a 3D surface ("wrapping" the image around the object). In recent decades, the advent of multi-pass rendering, multitexturing, mipmaps, and more complex mappings such as height mapping, bump mapping, normal mapping, displacement mapping, reflection mapping, specular mapping, occlusion mapping, and many other variations on the technique (controlled by a materials system) have made it possible to simulate near-photorealism in real time by vastly reducing the number of polygons and lighting calculations needed to construct a realistic and functional 3D scene. Texture maps A texture map is an image applied ("mapped") to the surface of a shape or polygon. This may be a bitmap image or a procedural texture. They may be stored in common image file formats, referenced by 3D model formats or material definitions, and assembled into resource bundles. 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. 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. Texture maps usually contain RGB color data (either stored as direct color, compressed formats, or indexed color), and sometimes an additional channel for alpha blending (RGBA) especially for billboards and decal overlay textures. It is possible to use the alpha channel (which may be convenient to store in formats parsed by hardware) for other uses such as specularity. Multiple texture maps (or channels) may be combined for control over specularity, normals, displacement, or subsurface scattering, 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 textures with multiple faces for environment mapping. Texture maps may be acquired by scanning or digital photography, designed in image manipulation software such as GIMP or Photoshop, or painted onto 3D surfaces directly in a 3D paint tool such as Mudbox or ZBrush. 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. This might be accomplished via planar projection or, alternatively, cylindrical or spherical 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" mapping from every piece of a surface (which is important for render mapping and light mapping, also known as baking). Texture mapping maps the model surface (or screen space 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 may be performed approximately by texture-space operations. Multitexturing is the use of more than one texture at a time on a polygon. For instance, a light map 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 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, for greater fidelity. Another multitexture technique is bump mapping, 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 video games, as graphics hardware has become powerful enough to accommodate it in real-time. The way that samples (e.g. when viewed as pixels on the screen) are calculated from the texels (texture pixels) is governed by texture filtering. The cheapest method is to use the nearest-neighbour interpolation, but bilinear interpolation or trilinear interpolation between mipmaps are two commonly used alternatives which reduce aliasing or jaggies. In the event of a texture coordinate being outside the texture, it is either clamped or wrapped. Anisotropic filtering better eliminates directional artefacts when viewing textures from oblique viewing angles. Texture streaming is a means of using data streams 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. As an optimization, it is possible to render detail from a complex, high-resolution model or expensive process (such as global illumination) into a surface texture (possibly on a low-resolution model). This technique is called baking (or render mapping) and 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) have used this technique. The original Quake software engine used on-the-fly baking to combine light maps and colour maps in a process called 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 linearly interpolates texture coordinates across a surface, making it the fastest form of texture mapping. Some software and hardware (such as the original PlayStation) project 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 or by an incremental error algorithm akin to Bresenham's line algorithm. In contrast to perpendicular polygons, this leads to noticeable distortion with perspective transformations (as shown in the figure: the checker box texture appears bent), especially as primitives near the camera. This distortion can be reduced by subdividing polygons into smaller polygons. Using quad primitives for rectangular objects can look less incorrect than if those rectangles were split into triangles. However, since interpolating four 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, offered efficient quad primitives. With perspective correction, triangles become equivalent to quad primitives 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. Affine linear interpolation across that horizontal span will look correct because every pixel along that line is the same distance from the viewer. Perspective correct texturing accounts for the vertices' positions in 3D space rather than simply interpolating coordinates in 2D screen space. While achieving the correct visual effect, perspective correct texturing is more expensive to calculate. To perform perspective correction of the texture coordinates u {\displaystyle u} and v {\displaystyle v} , with z {\displaystyle z} being the depth component from the viewer's point of view, it is possible to take advantage of the fact that the values 1 z {\displaystyle {\frac {1}{z}}} , u z {\displaystyle {\frac {u}{z}}} , and v z {\displaystyle {\frac {v}{z}}} are linear in screen space across the surface being textured. In contrast, the original z {\displaystyle z} , u {\displaystyle u} , and v {\displaystyle v} , before the division, are not linear across the surface in screen space. It is therefore possible to linearly interpolate these reciprocals across the surface, computing corrected values at each pixel, to produce a perspective correct texture mapping. To do this, the reciprocals at each vertex of the geometry (three points for a triangle) are calculated. Vertex n {\displaystyle n} has reciprocals u n z n {\displaystyle {\frac {u_{n}}{z_{n}}}} , v n z n {\displaystyle {\frac {v_{n}}{z_{n}}}} , and 1 z n {\displaystyle {\frac {1}{z_{n}}}} . Then, linear interpolation can be done on these reciprocals between the n {\displaystyle 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 {\displaystyle u_{i},v_{i}} and 1 z i {\displaystyle {\frac {1}{z_{i}}}} (reciprocal z i {\displaystyle z_{i}} ). However, as our division by z {\displaystyle z} altered their coordinate system, this u i , v i {\displaystyle u_{i},v_{i}} cannot be used as texture coordinates. To correct back to the u , v {\displaystyle u,v} space, the corrected z {\displaystyle z} is calculated by taking the reciprocal once again: z c o r r e c t = 1 1 z i {\displaystyle z_{correct}={\frac {1}{\frac {1}{z_{i}}}}} . This is then used to correct the u i , v i {\displaystyle u_{i},v_{i}} coordinates: u c o r r e c t = u i ⋅ z i {\displaystyle u_{correct}=u_{i}\cdot z_{i}} and v c o r r e c t = v i ⋅ z i {\displaystyle v_{correct}=v_{i}\cdot z_{i}} . This correction makes it so that the difference from pixel to pixel between texture coordinates is smaller in parts of the polygon that are closer to the viewer (stretching the texture wider) and is larger in parts that are farther away (compressing the texture). Affine texture mapping directly interpolates a texture coordinate u α {\displaystyle u_{\alpha }} between two endpoints u 0 {\displaystyle u_{0}} and u 1 {\displaystyle u_{1}} : u α = ( 1 − α ) u 0 + α u 1 {\displaystyle u_{\alpha }=(1-\alpha )u_{0}+\alpha u_{1}} where 0 ≤ α ≤ 1 {\displaystyle 0\leq \alpha \leq 1} . Perspective correct mapping interpolates after dividing by depth z {\displaystyle z} , then uses its interpolated reciprocal to recover the correct coordinate: u α = ( 1 − α ) u 0 z 0 + α u 1 z 1 ( 1 − α ) 1 z 0 + α 1 z 1 {\displaystyle u_{\alpha }={\frac {(1-\alpha ){\frac {u_{0}}{z_{0}}}+\alpha {\frac {u_{1}}{z_{1}}}}{(1-\alpha ){\frac {1}{z_{0}}}+\alpha {\frac {1}{z_{1}}}}}} 3D graphics hardware typically supports perspective correct texturing. Various techniques have evolved for rendering texture mapped geometry into images with different quality and precision trade-offs, which can be applied to both software and hardware. Classic software texture mappers generally only performed simple texture mapping with one lighting effect at most (typically applied through a lookup table), and the perspective correctness was about 16 times more expensive.[compared to?] The Doom engine restricted the world to vertical walls and horizontal floors and 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 and 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 which allowed the appearance of greater freedom while using the same rendering technique. Some engines were able to render texture mapped heightmaps (e.g. Nova Logic'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. Every triangle can be further subdivided into groups of about 16 pixels in order to achieve two goals: keeping the arithmetic mill busy at all times and producing faster arithmetic results.[vague] 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 made extensive use of this because it only supported affine mapping in hardware and had a relatively high triangle throughput compared to its peers. Software renderers generally prefer 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), thus lessening the overhead further. Another reason is that affine texture mapping does not fit into the low number of CPU registers of the x86 CPU; the 68000 and RISC processors are much more suited for that approach. 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. As the polygons are rendered independently, 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.[original research?] One other technique is to approximate the perspective with a faster calculation, such as a polynomial. A second uses the 1 z i {\textstyle {\frac {1}{z_{i}}}} value of the last two drawn pixels to linearly extrapolate the next value. For the latter, the division is then done starting from those values so that all that has to be divided is a small remainder. However, the amount of bookkeeping needed makes this technique too slow on most systems.[citation needed] A third technique, used by the Build Engine (used, most notably, in Duke Nukem 3D), builds on the constant distance trick used by the Doom engine by finding and rendering along the line of constant distance for arbitrary polygons. 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) and broadcast digital video effects machines such as the Ampex ADO. Texture mapping hardware later appeared in arcade cabinets, consumer video game consoles, and PC video cards in the mid-1990s. In flight simulations, texture mapping provided important motion and altitude cues necessary for pilot training not available on untextured surfaces. Additionally, texture mapping was implemented so that real-time processing of prefiltered texture patterns stored in memory could be accessed by the video processor in real-time. Modern graphics processing units (GPUs) provide specialised fixed function units called texture samplers, or texture mapping units, to perform texture mapping, usually with trilinear filtering or better multi-tap anisotropic filtering 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 implementations combine texture mapping with hidden-surface determination in tile-based deferred rendering or scanline rendering; such systems only fetch the visible texels at the expense of using greater workspace for transformed vertices. Most systems have settled on the z-buffering approach, which can still reduce the texture mapping workload with front-to-back sorting. On earlier graphics hardware, there were two competing paradigms of how to deliver a texture to the screen: Of these methods, inverse texture mapping has become standard in modern hardware. 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 of this method 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 is that the memory access pattern in the texture space 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 texture mapping, but can also be adapted for perspective correctness. 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. This was used by some hardware, such as the 3DO, the Sega Saturn 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 the § Affine texture mapping section above). The NV1 hardware also allowed a quadratic interpolation mode to provide an even better approximation of perspective correctness. UV mapping became an important technique for 3D modelling and assisted in clipping the texture correctly when the primitive went past the edge of the screen, but existing hardware did not provide effective implementations of this. These shortcomings could have been addressed with further development, but GPU design has mostly shifted toward using the inverse mapping technique. Applications Beyond 3D rendering, the availability of texture mapping hardware has inspired its use for accelerating other tasks: It is possible to use texture mapping hardware to accelerate both the reconstruction of voxel data sets from tomographic scans, and to visualize the results. Many user interfaces use texture mapping to accelerate animated transitions of screen elements, e.g. Exposé in Mac OS X. See also References Software External links
========================================
[SOURCE: https://en.wikipedia.org/wiki/Texture_mapping#Other_techniques] | [TOKENS: 4408]
Contents Texture mapping 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 apart so that it can be unfolded into a 2D coordinate space (UV space). Semantic Texture mapping can multiply refer to (1) the task of unwrapping a 3D model (converting the surface of a 3D model into a 2D texture map), (2) applying a 2D texture map onto the surface of a 3D model, and (3) the 3D software algorithm that performs both tasks. A texture map refers to a 2D image ("texture") that adds visual detail to a 3D model. The image can be stored as a raster graphic. A texture that stores a specific property—such as bumpiness, reflectivity, or transparency—is also referred to as a color map or roughness map. The coordinate space that converts from a 3D model's 3D space into a 2D space for sampling from the texture map is variously called UV space, UV coordinates, or texture space. Algorithm The following is a simplified explanation of how an algorithm could work to render an image: History The original technique was pioneered by Edwin Catmull in 1974 as part of his doctoral thesis. Texture mapping originally referred to diffuse mapping, a method that simply mapped pixels from a texture to a 3D surface ("wrapping" the image around the object). In recent decades, the advent of multi-pass rendering, multitexturing, mipmaps, and more complex mappings such as height mapping, bump mapping, normal mapping, displacement mapping, reflection mapping, specular mapping, occlusion mapping, and many other variations on the technique (controlled by a materials system) have made it possible to simulate near-photorealism in real time by vastly reducing the number of polygons and lighting calculations needed to construct a realistic and functional 3D scene. Texture maps A texture map is an image applied ("mapped") to the surface of a shape or polygon. This may be a bitmap image or a procedural texture. They may be stored in common image file formats, referenced by 3D model formats or material definitions, and assembled into resource bundles. 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. 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. Texture maps usually contain RGB color data (either stored as direct color, compressed formats, or indexed color), and sometimes an additional channel for alpha blending (RGBA) especially for billboards and decal overlay textures. It is possible to use the alpha channel (which may be convenient to store in formats parsed by hardware) for other uses such as specularity. Multiple texture maps (or channels) may be combined for control over specularity, normals, displacement, or subsurface scattering, 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 textures with multiple faces for environment mapping. Texture maps may be acquired by scanning or digital photography, designed in image manipulation software such as GIMP or Photoshop, or painted onto 3D surfaces directly in a 3D paint tool such as Mudbox or ZBrush. 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. This might be accomplished via planar projection or, alternatively, cylindrical or spherical 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" mapping from every piece of a surface (which is important for render mapping and light mapping, also known as baking). Texture mapping maps the model surface (or screen space 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 may be performed approximately by texture-space operations. Multitexturing is the use of more than one texture at a time on a polygon. For instance, a light map 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 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, for greater fidelity. Another multitexture technique is bump mapping, 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 video games, as graphics hardware has become powerful enough to accommodate it in real-time. The way that samples (e.g. when viewed as pixels on the screen) are calculated from the texels (texture pixels) is governed by texture filtering. The cheapest method is to use the nearest-neighbour interpolation, but bilinear interpolation or trilinear interpolation between mipmaps are two commonly used alternatives which reduce aliasing or jaggies. In the event of a texture coordinate being outside the texture, it is either clamped or wrapped. Anisotropic filtering better eliminates directional artefacts when viewing textures from oblique viewing angles. Texture streaming is a means of using data streams 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. As an optimization, it is possible to render detail from a complex, high-resolution model or expensive process (such as global illumination) into a surface texture (possibly on a low-resolution model). This technique is called baking (or render mapping) and 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) have used this technique. The original Quake software engine used on-the-fly baking to combine light maps and colour maps in a process called 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 linearly interpolates texture coordinates across a surface, making it the fastest form of texture mapping. Some software and hardware (such as the original PlayStation) project 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 or by an incremental error algorithm akin to Bresenham's line algorithm. In contrast to perpendicular polygons, this leads to noticeable distortion with perspective transformations (as shown in the figure: the checker box texture appears bent), especially as primitives near the camera. This distortion can be reduced by subdividing polygons into smaller polygons. Using quad primitives for rectangular objects can look less incorrect than if those rectangles were split into triangles. However, since interpolating four 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, offered efficient quad primitives. With perspective correction, triangles become equivalent to quad primitives 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. Affine linear interpolation across that horizontal span will look correct because every pixel along that line is the same distance from the viewer. Perspective correct texturing accounts for the vertices' positions in 3D space rather than simply interpolating coordinates in 2D screen space. While achieving the correct visual effect, perspective correct texturing is more expensive to calculate. To perform perspective correction of the texture coordinates u {\displaystyle u} and v {\displaystyle v} , with z {\displaystyle z} being the depth component from the viewer's point of view, it is possible to take advantage of the fact that the values 1 z {\displaystyle {\frac {1}{z}}} , u z {\displaystyle {\frac {u}{z}}} , and v z {\displaystyle {\frac {v}{z}}} are linear in screen space across the surface being textured. In contrast, the original z {\displaystyle z} , u {\displaystyle u} , and v {\displaystyle v} , before the division, are not linear across the surface in screen space. It is therefore possible to linearly interpolate these reciprocals across the surface, computing corrected values at each pixel, to produce a perspective correct texture mapping. To do this, the reciprocals at each vertex of the geometry (three points for a triangle) are calculated. Vertex n {\displaystyle n} has reciprocals u n z n {\displaystyle {\frac {u_{n}}{z_{n}}}} , v n z n {\displaystyle {\frac {v_{n}}{z_{n}}}} , and 1 z n {\displaystyle {\frac {1}{z_{n}}}} . Then, linear interpolation can be done on these reciprocals between the n {\displaystyle 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 {\displaystyle u_{i},v_{i}} and 1 z i {\displaystyle {\frac {1}{z_{i}}}} (reciprocal z i {\displaystyle z_{i}} ). However, as our division by z {\displaystyle z} altered their coordinate system, this u i , v i {\displaystyle u_{i},v_{i}} cannot be used as texture coordinates. To correct back to the u , v {\displaystyle u,v} space, the corrected z {\displaystyle z} is calculated by taking the reciprocal once again: z c o r r e c t = 1 1 z i {\displaystyle z_{correct}={\frac {1}{\frac {1}{z_{i}}}}} . This is then used to correct the u i , v i {\displaystyle u_{i},v_{i}} coordinates: u c o r r e c t = u i ⋅ z i {\displaystyle u_{correct}=u_{i}\cdot z_{i}} and v c o r r e c t = v i ⋅ z i {\displaystyle v_{correct}=v_{i}\cdot z_{i}} . This correction makes it so that the difference from pixel to pixel between texture coordinates is smaller in parts of the polygon that are closer to the viewer (stretching the texture wider) and is larger in parts that are farther away (compressing the texture). Affine texture mapping directly interpolates a texture coordinate u α {\displaystyle u_{\alpha }} between two endpoints u 0 {\displaystyle u_{0}} and u 1 {\displaystyle u_{1}} : u α = ( 1 − α ) u 0 + α u 1 {\displaystyle u_{\alpha }=(1-\alpha )u_{0}+\alpha u_{1}} where 0 ≤ α ≤ 1 {\displaystyle 0\leq \alpha \leq 1} . Perspective correct mapping interpolates after dividing by depth z {\displaystyle z} , then uses its interpolated reciprocal to recover the correct coordinate: u α = ( 1 − α ) u 0 z 0 + α u 1 z 1 ( 1 − α ) 1 z 0 + α 1 z 1 {\displaystyle u_{\alpha }={\frac {(1-\alpha ){\frac {u_{0}}{z_{0}}}+\alpha {\frac {u_{1}}{z_{1}}}}{(1-\alpha ){\frac {1}{z_{0}}}+\alpha {\frac {1}{z_{1}}}}}} 3D graphics hardware typically supports perspective correct texturing. Various techniques have evolved for rendering texture mapped geometry into images with different quality and precision trade-offs, which can be applied to both software and hardware. Classic software texture mappers generally only performed simple texture mapping with one lighting effect at most (typically applied through a lookup table), and the perspective correctness was about 16 times more expensive.[compared to?] The Doom engine restricted the world to vertical walls and horizontal floors and 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 and 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 which allowed the appearance of greater freedom while using the same rendering technique. Some engines were able to render texture mapped heightmaps (e.g. Nova Logic'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. Every triangle can be further subdivided into groups of about 16 pixels in order to achieve two goals: keeping the arithmetic mill busy at all times and producing faster arithmetic results.[vague] 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 made extensive use of this because it only supported affine mapping in hardware and had a relatively high triangle throughput compared to its peers. Software renderers generally prefer 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), thus lessening the overhead further. Another reason is that affine texture mapping does not fit into the low number of CPU registers of the x86 CPU; the 68000 and RISC processors are much more suited for that approach. 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. As the polygons are rendered independently, 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.[original research?] One other technique is to approximate the perspective with a faster calculation, such as a polynomial. A second uses the 1 z i {\textstyle {\frac {1}{z_{i}}}} value of the last two drawn pixels to linearly extrapolate the next value. For the latter, the division is then done starting from those values so that all that has to be divided is a small remainder. However, the amount of bookkeeping needed makes this technique too slow on most systems.[citation needed] A third technique, used by the Build Engine (used, most notably, in Duke Nukem 3D), builds on the constant distance trick used by the Doom engine by finding and rendering along the line of constant distance for arbitrary polygons. 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) and broadcast digital video effects machines such as the Ampex ADO. Texture mapping hardware later appeared in arcade cabinets, consumer video game consoles, and PC video cards in the mid-1990s. In flight simulations, texture mapping provided important motion and altitude cues necessary for pilot training not available on untextured surfaces. Additionally, texture mapping was implemented so that real-time processing of prefiltered texture patterns stored in memory could be accessed by the video processor in real-time. Modern graphics processing units (GPUs) provide specialised fixed function units called texture samplers, or texture mapping units, to perform texture mapping, usually with trilinear filtering or better multi-tap anisotropic filtering 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 implementations combine texture mapping with hidden-surface determination in tile-based deferred rendering or scanline rendering; such systems only fetch the visible texels at the expense of using greater workspace for transformed vertices. Most systems have settled on the z-buffering approach, which can still reduce the texture mapping workload with front-to-back sorting. On earlier graphics hardware, there were two competing paradigms of how to deliver a texture to the screen: Of these methods, inverse texture mapping has become standard in modern hardware. 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 of this method 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 is that the memory access pattern in the texture space 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 texture mapping, but can also be adapted for perspective correctness. 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. This was used by some hardware, such as the 3DO, the Sega Saturn 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 the § Affine texture mapping section above). The NV1 hardware also allowed a quadratic interpolation mode to provide an even better approximation of perspective correctness. UV mapping became an important technique for 3D modelling and assisted in clipping the texture correctly when the primitive went past the edge of the screen, but existing hardware did not provide effective implementations of this. These shortcomings could have been addressed with further development, but GPU design has mostly shifted toward using the inverse mapping technique. Applications Beyond 3D rendering, the availability of texture mapping hardware has inspired its use for accelerating other tasks: It is possible to use texture mapping hardware to accelerate both the reconstruction of voxel data sets from tomographic scans, and to visualize the results. Many user interfaces use texture mapping to accelerate animated transitions of screen elements, e.g. Exposé in Mac OS X. See also References Software External links
========================================
[SOURCE: https://en.wikipedia.org/wiki/Texture_mapping#Forward_texture_mapping] | [TOKENS: 4408]
Contents Texture mapping 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 apart so that it can be unfolded into a 2D coordinate space (UV space). Semantic Texture mapping can multiply refer to (1) the task of unwrapping a 3D model (converting the surface of a 3D model into a 2D texture map), (2) applying a 2D texture map onto the surface of a 3D model, and (3) the 3D software algorithm that performs both tasks. A texture map refers to a 2D image ("texture") that adds visual detail to a 3D model. The image can be stored as a raster graphic. A texture that stores a specific property—such as bumpiness, reflectivity, or transparency—is also referred to as a color map or roughness map. The coordinate space that converts from a 3D model's 3D space into a 2D space for sampling from the texture map is variously called UV space, UV coordinates, or texture space. Algorithm The following is a simplified explanation of how an algorithm could work to render an image: History The original technique was pioneered by Edwin Catmull in 1974 as part of his doctoral thesis. Texture mapping originally referred to diffuse mapping, a method that simply mapped pixels from a texture to a 3D surface ("wrapping" the image around the object). In recent decades, the advent of multi-pass rendering, multitexturing, mipmaps, and more complex mappings such as height mapping, bump mapping, normal mapping, displacement mapping, reflection mapping, specular mapping, occlusion mapping, and many other variations on the technique (controlled by a materials system) have made it possible to simulate near-photorealism in real time by vastly reducing the number of polygons and lighting calculations needed to construct a realistic and functional 3D scene. Texture maps A texture map is an image applied ("mapped") to the surface of a shape or polygon. This may be a bitmap image or a procedural texture. They may be stored in common image file formats, referenced by 3D model formats or material definitions, and assembled into resource bundles. 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. 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. Texture maps usually contain RGB color data (either stored as direct color, compressed formats, or indexed color), and sometimes an additional channel for alpha blending (RGBA) especially for billboards and decal overlay textures. It is possible to use the alpha channel (which may be convenient to store in formats parsed by hardware) for other uses such as specularity. Multiple texture maps (or channels) may be combined for control over specularity, normals, displacement, or subsurface scattering, 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 textures with multiple faces for environment mapping. Texture maps may be acquired by scanning or digital photography, designed in image manipulation software such as GIMP or Photoshop, or painted onto 3D surfaces directly in a 3D paint tool such as Mudbox or ZBrush. 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. This might be accomplished via planar projection or, alternatively, cylindrical or spherical 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" mapping from every piece of a surface (which is important for render mapping and light mapping, also known as baking). Texture mapping maps the model surface (or screen space 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 may be performed approximately by texture-space operations. Multitexturing is the use of more than one texture at a time on a polygon. For instance, a light map 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 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, for greater fidelity. Another multitexture technique is bump mapping, 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 video games, as graphics hardware has become powerful enough to accommodate it in real-time. The way that samples (e.g. when viewed as pixels on the screen) are calculated from the texels (texture pixels) is governed by texture filtering. The cheapest method is to use the nearest-neighbour interpolation, but bilinear interpolation or trilinear interpolation between mipmaps are two commonly used alternatives which reduce aliasing or jaggies. In the event of a texture coordinate being outside the texture, it is either clamped or wrapped. Anisotropic filtering better eliminates directional artefacts when viewing textures from oblique viewing angles. Texture streaming is a means of using data streams 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. As an optimization, it is possible to render detail from a complex, high-resolution model or expensive process (such as global illumination) into a surface texture (possibly on a low-resolution model). This technique is called baking (or render mapping) and 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) have used this technique. The original Quake software engine used on-the-fly baking to combine light maps and colour maps in a process called 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 linearly interpolates texture coordinates across a surface, making it the fastest form of texture mapping. Some software and hardware (such as the original PlayStation) project 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 or by an incremental error algorithm akin to Bresenham's line algorithm. In contrast to perpendicular polygons, this leads to noticeable distortion with perspective transformations (as shown in the figure: the checker box texture appears bent), especially as primitives near the camera. This distortion can be reduced by subdividing polygons into smaller polygons. Using quad primitives for rectangular objects can look less incorrect than if those rectangles were split into triangles. However, since interpolating four 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, offered efficient quad primitives. With perspective correction, triangles become equivalent to quad primitives 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. Affine linear interpolation across that horizontal span will look correct because every pixel along that line is the same distance from the viewer. Perspective correct texturing accounts for the vertices' positions in 3D space rather than simply interpolating coordinates in 2D screen space. While achieving the correct visual effect, perspective correct texturing is more expensive to calculate. To perform perspective correction of the texture coordinates u {\displaystyle u} and v {\displaystyle v} , with z {\displaystyle z} being the depth component from the viewer's point of view, it is possible to take advantage of the fact that the values 1 z {\displaystyle {\frac {1}{z}}} , u z {\displaystyle {\frac {u}{z}}} , and v z {\displaystyle {\frac {v}{z}}} are linear in screen space across the surface being textured. In contrast, the original z {\displaystyle z} , u {\displaystyle u} , and v {\displaystyle v} , before the division, are not linear across the surface in screen space. It is therefore possible to linearly interpolate these reciprocals across the surface, computing corrected values at each pixel, to produce a perspective correct texture mapping. To do this, the reciprocals at each vertex of the geometry (three points for a triangle) are calculated. Vertex n {\displaystyle n} has reciprocals u n z n {\displaystyle {\frac {u_{n}}{z_{n}}}} , v n z n {\displaystyle {\frac {v_{n}}{z_{n}}}} , and 1 z n {\displaystyle {\frac {1}{z_{n}}}} . Then, linear interpolation can be done on these reciprocals between the n {\displaystyle 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 {\displaystyle u_{i},v_{i}} and 1 z i {\displaystyle {\frac {1}{z_{i}}}} (reciprocal z i {\displaystyle z_{i}} ). However, as our division by z {\displaystyle z} altered their coordinate system, this u i , v i {\displaystyle u_{i},v_{i}} cannot be used as texture coordinates. To correct back to the u , v {\displaystyle u,v} space, the corrected z {\displaystyle z} is calculated by taking the reciprocal once again: z c o r r e c t = 1 1 z i {\displaystyle z_{correct}={\frac {1}{\frac {1}{z_{i}}}}} . This is then used to correct the u i , v i {\displaystyle u_{i},v_{i}} coordinates: u c o r r e c t = u i ⋅ z i {\displaystyle u_{correct}=u_{i}\cdot z_{i}} and v c o r r e c t = v i ⋅ z i {\displaystyle v_{correct}=v_{i}\cdot z_{i}} . This correction makes it so that the difference from pixel to pixel between texture coordinates is smaller in parts of the polygon that are closer to the viewer (stretching the texture wider) and is larger in parts that are farther away (compressing the texture). Affine texture mapping directly interpolates a texture coordinate u α {\displaystyle u_{\alpha }} between two endpoints u 0 {\displaystyle u_{0}} and u 1 {\displaystyle u_{1}} : u α = ( 1 − α ) u 0 + α u 1 {\displaystyle u_{\alpha }=(1-\alpha )u_{0}+\alpha u_{1}} where 0 ≤ α ≤ 1 {\displaystyle 0\leq \alpha \leq 1} . Perspective correct mapping interpolates after dividing by depth z {\displaystyle z} , then uses its interpolated reciprocal to recover the correct coordinate: u α = ( 1 − α ) u 0 z 0 + α u 1 z 1 ( 1 − α ) 1 z 0 + α 1 z 1 {\displaystyle u_{\alpha }={\frac {(1-\alpha ){\frac {u_{0}}{z_{0}}}+\alpha {\frac {u_{1}}{z_{1}}}}{(1-\alpha ){\frac {1}{z_{0}}}+\alpha {\frac {1}{z_{1}}}}}} 3D graphics hardware typically supports perspective correct texturing. Various techniques have evolved for rendering texture mapped geometry into images with different quality and precision trade-offs, which can be applied to both software and hardware. Classic software texture mappers generally only performed simple texture mapping with one lighting effect at most (typically applied through a lookup table), and the perspective correctness was about 16 times more expensive.[compared to?] The Doom engine restricted the world to vertical walls and horizontal floors and 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 and 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 which allowed the appearance of greater freedom while using the same rendering technique. Some engines were able to render texture mapped heightmaps (e.g. Nova Logic'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. Every triangle can be further subdivided into groups of about 16 pixels in order to achieve two goals: keeping the arithmetic mill busy at all times and producing faster arithmetic results.[vague] 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 made extensive use of this because it only supported affine mapping in hardware and had a relatively high triangle throughput compared to its peers. Software renderers generally prefer 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), thus lessening the overhead further. Another reason is that affine texture mapping does not fit into the low number of CPU registers of the x86 CPU; the 68000 and RISC processors are much more suited for that approach. 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. As the polygons are rendered independently, 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.[original research?] One other technique is to approximate the perspective with a faster calculation, such as a polynomial. A second uses the 1 z i {\textstyle {\frac {1}{z_{i}}}} value of the last two drawn pixels to linearly extrapolate the next value. For the latter, the division is then done starting from those values so that all that has to be divided is a small remainder. However, the amount of bookkeeping needed makes this technique too slow on most systems.[citation needed] A third technique, used by the Build Engine (used, most notably, in Duke Nukem 3D), builds on the constant distance trick used by the Doom engine by finding and rendering along the line of constant distance for arbitrary polygons. 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) and broadcast digital video effects machines such as the Ampex ADO. Texture mapping hardware later appeared in arcade cabinets, consumer video game consoles, and PC video cards in the mid-1990s. In flight simulations, texture mapping provided important motion and altitude cues necessary for pilot training not available on untextured surfaces. Additionally, texture mapping was implemented so that real-time processing of prefiltered texture patterns stored in memory could be accessed by the video processor in real-time. Modern graphics processing units (GPUs) provide specialised fixed function units called texture samplers, or texture mapping units, to perform texture mapping, usually with trilinear filtering or better multi-tap anisotropic filtering 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 implementations combine texture mapping with hidden-surface determination in tile-based deferred rendering or scanline rendering; such systems only fetch the visible texels at the expense of using greater workspace for transformed vertices. Most systems have settled on the z-buffering approach, which can still reduce the texture mapping workload with front-to-back sorting. On earlier graphics hardware, there were two competing paradigms of how to deliver a texture to the screen: Of these methods, inverse texture mapping has become standard in modern hardware. 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 of this method 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 is that the memory access pattern in the texture space 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 texture mapping, but can also be adapted for perspective correctness. 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. This was used by some hardware, such as the 3DO, the Sega Saturn 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 the § Affine texture mapping section above). The NV1 hardware also allowed a quadratic interpolation mode to provide an even better approximation of perspective correctness. UV mapping became an important technique for 3D modelling and assisted in clipping the texture correctly when the primitive went past the edge of the screen, but existing hardware did not provide effective implementations of this. These shortcomings could have been addressed with further development, but GPU design has mostly shifted toward using the inverse mapping technique. Applications Beyond 3D rendering, the availability of texture mapping hardware has inspired its use for accelerating other tasks: It is possible to use texture mapping hardware to accelerate both the reconstruction of voxel data sets from tomographic scans, and to visualize the results. Many user interfaces use texture mapping to accelerate animated transitions of screen elements, e.g. Exposé in Mac OS X. See also References Software External links
========================================
[SOURCE: https://en.wikipedia.org/wiki/Texture_mapping#Inverse_texture_mapping] | [TOKENS: 4408]
Contents Texture mapping 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 apart so that it can be unfolded into a 2D coordinate space (UV space). Semantic Texture mapping can multiply refer to (1) the task of unwrapping a 3D model (converting the surface of a 3D model into a 2D texture map), (2) applying a 2D texture map onto the surface of a 3D model, and (3) the 3D software algorithm that performs both tasks. A texture map refers to a 2D image ("texture") that adds visual detail to a 3D model. The image can be stored as a raster graphic. A texture that stores a specific property—such as bumpiness, reflectivity, or transparency—is also referred to as a color map or roughness map. The coordinate space that converts from a 3D model's 3D space into a 2D space for sampling from the texture map is variously called UV space, UV coordinates, or texture space. Algorithm The following is a simplified explanation of how an algorithm could work to render an image: History The original technique was pioneered by Edwin Catmull in 1974 as part of his doctoral thesis. Texture mapping originally referred to diffuse mapping, a method that simply mapped pixels from a texture to a 3D surface ("wrapping" the image around the object). In recent decades, the advent of multi-pass rendering, multitexturing, mipmaps, and more complex mappings such as height mapping, bump mapping, normal mapping, displacement mapping, reflection mapping, specular mapping, occlusion mapping, and many other variations on the technique (controlled by a materials system) have made it possible to simulate near-photorealism in real time by vastly reducing the number of polygons and lighting calculations needed to construct a realistic and functional 3D scene. Texture maps A texture map is an image applied ("mapped") to the surface of a shape or polygon. This may be a bitmap image or a procedural texture. They may be stored in common image file formats, referenced by 3D model formats or material definitions, and assembled into resource bundles. 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. 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. Texture maps usually contain RGB color data (either stored as direct color, compressed formats, or indexed color), and sometimes an additional channel for alpha blending (RGBA) especially for billboards and decal overlay textures. It is possible to use the alpha channel (which may be convenient to store in formats parsed by hardware) for other uses such as specularity. Multiple texture maps (or channels) may be combined for control over specularity, normals, displacement, or subsurface scattering, 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 textures with multiple faces for environment mapping. Texture maps may be acquired by scanning or digital photography, designed in image manipulation software such as GIMP or Photoshop, or painted onto 3D surfaces directly in a 3D paint tool such as Mudbox or ZBrush. 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. This might be accomplished via planar projection or, alternatively, cylindrical or spherical 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" mapping from every piece of a surface (which is important for render mapping and light mapping, also known as baking). Texture mapping maps the model surface (or screen space 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 may be performed approximately by texture-space operations. Multitexturing is the use of more than one texture at a time on a polygon. For instance, a light map 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 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, for greater fidelity. Another multitexture technique is bump mapping, 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 video games, as graphics hardware has become powerful enough to accommodate it in real-time. The way that samples (e.g. when viewed as pixels on the screen) are calculated from the texels (texture pixels) is governed by texture filtering. The cheapest method is to use the nearest-neighbour interpolation, but bilinear interpolation or trilinear interpolation between mipmaps are two commonly used alternatives which reduce aliasing or jaggies. In the event of a texture coordinate being outside the texture, it is either clamped or wrapped. Anisotropic filtering better eliminates directional artefacts when viewing textures from oblique viewing angles. Texture streaming is a means of using data streams 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. As an optimization, it is possible to render detail from a complex, high-resolution model or expensive process (such as global illumination) into a surface texture (possibly on a low-resolution model). This technique is called baking (or render mapping) and 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) have used this technique. The original Quake software engine used on-the-fly baking to combine light maps and colour maps in a process called 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 linearly interpolates texture coordinates across a surface, making it the fastest form of texture mapping. Some software and hardware (such as the original PlayStation) project 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 or by an incremental error algorithm akin to Bresenham's line algorithm. In contrast to perpendicular polygons, this leads to noticeable distortion with perspective transformations (as shown in the figure: the checker box texture appears bent), especially as primitives near the camera. This distortion can be reduced by subdividing polygons into smaller polygons. Using quad primitives for rectangular objects can look less incorrect than if those rectangles were split into triangles. However, since interpolating four 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, offered efficient quad primitives. With perspective correction, triangles become equivalent to quad primitives 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. Affine linear interpolation across that horizontal span will look correct because every pixel along that line is the same distance from the viewer. Perspective correct texturing accounts for the vertices' positions in 3D space rather than simply interpolating coordinates in 2D screen space. While achieving the correct visual effect, perspective correct texturing is more expensive to calculate. To perform perspective correction of the texture coordinates u {\displaystyle u} and v {\displaystyle v} , with z {\displaystyle z} being the depth component from the viewer's point of view, it is possible to take advantage of the fact that the values 1 z {\displaystyle {\frac {1}{z}}} , u z {\displaystyle {\frac {u}{z}}} , and v z {\displaystyle {\frac {v}{z}}} are linear in screen space across the surface being textured. In contrast, the original z {\displaystyle z} , u {\displaystyle u} , and v {\displaystyle v} , before the division, are not linear across the surface in screen space. It is therefore possible to linearly interpolate these reciprocals across the surface, computing corrected values at each pixel, to produce a perspective correct texture mapping. To do this, the reciprocals at each vertex of the geometry (three points for a triangle) are calculated. Vertex n {\displaystyle n} has reciprocals u n z n {\displaystyle {\frac {u_{n}}{z_{n}}}} , v n z n {\displaystyle {\frac {v_{n}}{z_{n}}}} , and 1 z n {\displaystyle {\frac {1}{z_{n}}}} . Then, linear interpolation can be done on these reciprocals between the n {\displaystyle 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 {\displaystyle u_{i},v_{i}} and 1 z i {\displaystyle {\frac {1}{z_{i}}}} (reciprocal z i {\displaystyle z_{i}} ). However, as our division by z {\displaystyle z} altered their coordinate system, this u i , v i {\displaystyle u_{i},v_{i}} cannot be used as texture coordinates. To correct back to the u , v {\displaystyle u,v} space, the corrected z {\displaystyle z} is calculated by taking the reciprocal once again: z c o r r e c t = 1 1 z i {\displaystyle z_{correct}={\frac {1}{\frac {1}{z_{i}}}}} . This is then used to correct the u i , v i {\displaystyle u_{i},v_{i}} coordinates: u c o r r e c t = u i ⋅ z i {\displaystyle u_{correct}=u_{i}\cdot z_{i}} and v c o r r e c t = v i ⋅ z i {\displaystyle v_{correct}=v_{i}\cdot z_{i}} . This correction makes it so that the difference from pixel to pixel between texture coordinates is smaller in parts of the polygon that are closer to the viewer (stretching the texture wider) and is larger in parts that are farther away (compressing the texture). Affine texture mapping directly interpolates a texture coordinate u α {\displaystyle u_{\alpha }} between two endpoints u 0 {\displaystyle u_{0}} and u 1 {\displaystyle u_{1}} : u α = ( 1 − α ) u 0 + α u 1 {\displaystyle u_{\alpha }=(1-\alpha )u_{0}+\alpha u_{1}} where 0 ≤ α ≤ 1 {\displaystyle 0\leq \alpha \leq 1} . Perspective correct mapping interpolates after dividing by depth z {\displaystyle z} , then uses its interpolated reciprocal to recover the correct coordinate: u α = ( 1 − α ) u 0 z 0 + α u 1 z 1 ( 1 − α ) 1 z 0 + α 1 z 1 {\displaystyle u_{\alpha }={\frac {(1-\alpha ){\frac {u_{0}}{z_{0}}}+\alpha {\frac {u_{1}}{z_{1}}}}{(1-\alpha ){\frac {1}{z_{0}}}+\alpha {\frac {1}{z_{1}}}}}} 3D graphics hardware typically supports perspective correct texturing. Various techniques have evolved for rendering texture mapped geometry into images with different quality and precision trade-offs, which can be applied to both software and hardware. Classic software texture mappers generally only performed simple texture mapping with one lighting effect at most (typically applied through a lookup table), and the perspective correctness was about 16 times more expensive.[compared to?] The Doom engine restricted the world to vertical walls and horizontal floors and 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 and 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 which allowed the appearance of greater freedom while using the same rendering technique. Some engines were able to render texture mapped heightmaps (e.g. Nova Logic'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. Every triangle can be further subdivided into groups of about 16 pixels in order to achieve two goals: keeping the arithmetic mill busy at all times and producing faster arithmetic results.[vague] 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 made extensive use of this because it only supported affine mapping in hardware and had a relatively high triangle throughput compared to its peers. Software renderers generally prefer 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), thus lessening the overhead further. Another reason is that affine texture mapping does not fit into the low number of CPU registers of the x86 CPU; the 68000 and RISC processors are much more suited for that approach. 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. As the polygons are rendered independently, 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.[original research?] One other technique is to approximate the perspective with a faster calculation, such as a polynomial. A second uses the 1 z i {\textstyle {\frac {1}{z_{i}}}} value of the last two drawn pixels to linearly extrapolate the next value. For the latter, the division is then done starting from those values so that all that has to be divided is a small remainder. However, the amount of bookkeeping needed makes this technique too slow on most systems.[citation needed] A third technique, used by the Build Engine (used, most notably, in Duke Nukem 3D), builds on the constant distance trick used by the Doom engine by finding and rendering along the line of constant distance for arbitrary polygons. 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) and broadcast digital video effects machines such as the Ampex ADO. Texture mapping hardware later appeared in arcade cabinets, consumer video game consoles, and PC video cards in the mid-1990s. In flight simulations, texture mapping provided important motion and altitude cues necessary for pilot training not available on untextured surfaces. Additionally, texture mapping was implemented so that real-time processing of prefiltered texture patterns stored in memory could be accessed by the video processor in real-time. Modern graphics processing units (GPUs) provide specialised fixed function units called texture samplers, or texture mapping units, to perform texture mapping, usually with trilinear filtering or better multi-tap anisotropic filtering 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 implementations combine texture mapping with hidden-surface determination in tile-based deferred rendering or scanline rendering; such systems only fetch the visible texels at the expense of using greater workspace for transformed vertices. Most systems have settled on the z-buffering approach, which can still reduce the texture mapping workload with front-to-back sorting. On earlier graphics hardware, there were two competing paradigms of how to deliver a texture to the screen: Of these methods, inverse texture mapping has become standard in modern hardware. 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 of this method 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 is that the memory access pattern in the texture space 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 texture mapping, but can also be adapted for perspective correctness. 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. This was used by some hardware, such as the 3DO, the Sega Saturn 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 the § Affine texture mapping section above). The NV1 hardware also allowed a quadratic interpolation mode to provide an even better approximation of perspective correctness. UV mapping became an important technique for 3D modelling and assisted in clipping the texture correctly when the primitive went past the edge of the screen, but existing hardware did not provide effective implementations of this. These shortcomings could have been addressed with further development, but GPU design has mostly shifted toward using the inverse mapping technique. Applications Beyond 3D rendering, the availability of texture mapping hardware has inspired its use for accelerating other tasks: It is possible to use texture mapping hardware to accelerate both the reconstruction of voxel data sets from tomographic scans, and to visualize the results. Many user interfaces use texture mapping to accelerate animated transitions of screen elements, e.g. Exposé in Mac OS X. See also References Software External links
========================================
[SOURCE: https://en.wikipedia.org/wiki/Texture_mapping#Tomography] | [TOKENS: 4408]
Contents Texture mapping 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 apart so that it can be unfolded into a 2D coordinate space (UV space). Semantic Texture mapping can multiply refer to (1) the task of unwrapping a 3D model (converting the surface of a 3D model into a 2D texture map), (2) applying a 2D texture map onto the surface of a 3D model, and (3) the 3D software algorithm that performs both tasks. A texture map refers to a 2D image ("texture") that adds visual detail to a 3D model. The image can be stored as a raster graphic. A texture that stores a specific property—such as bumpiness, reflectivity, or transparency—is also referred to as a color map or roughness map. The coordinate space that converts from a 3D model's 3D space into a 2D space for sampling from the texture map is variously called UV space, UV coordinates, or texture space. Algorithm The following is a simplified explanation of how an algorithm could work to render an image: History The original technique was pioneered by Edwin Catmull in 1974 as part of his doctoral thesis. Texture mapping originally referred to diffuse mapping, a method that simply mapped pixels from a texture to a 3D surface ("wrapping" the image around the object). In recent decades, the advent of multi-pass rendering, multitexturing, mipmaps, and more complex mappings such as height mapping, bump mapping, normal mapping, displacement mapping, reflection mapping, specular mapping, occlusion mapping, and many other variations on the technique (controlled by a materials system) have made it possible to simulate near-photorealism in real time by vastly reducing the number of polygons and lighting calculations needed to construct a realistic and functional 3D scene. Texture maps A texture map is an image applied ("mapped") to the surface of a shape or polygon. This may be a bitmap image or a procedural texture. They may be stored in common image file formats, referenced by 3D model formats or material definitions, and assembled into resource bundles. 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. 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. Texture maps usually contain RGB color data (either stored as direct color, compressed formats, or indexed color), and sometimes an additional channel for alpha blending (RGBA) especially for billboards and decal overlay textures. It is possible to use the alpha channel (which may be convenient to store in formats parsed by hardware) for other uses such as specularity. Multiple texture maps (or channels) may be combined for control over specularity, normals, displacement, or subsurface scattering, 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 textures with multiple faces for environment mapping. Texture maps may be acquired by scanning or digital photography, designed in image manipulation software such as GIMP or Photoshop, or painted onto 3D surfaces directly in a 3D paint tool such as Mudbox or ZBrush. 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. This might be accomplished via planar projection or, alternatively, cylindrical or spherical 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" mapping from every piece of a surface (which is important for render mapping and light mapping, also known as baking). Texture mapping maps the model surface (or screen space 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 may be performed approximately by texture-space operations. Multitexturing is the use of more than one texture at a time on a polygon. For instance, a light map 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 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, for greater fidelity. Another multitexture technique is bump mapping, 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 video games, as graphics hardware has become powerful enough to accommodate it in real-time. The way that samples (e.g. when viewed as pixels on the screen) are calculated from the texels (texture pixels) is governed by texture filtering. The cheapest method is to use the nearest-neighbour interpolation, but bilinear interpolation or trilinear interpolation between mipmaps are two commonly used alternatives which reduce aliasing or jaggies. In the event of a texture coordinate being outside the texture, it is either clamped or wrapped. Anisotropic filtering better eliminates directional artefacts when viewing textures from oblique viewing angles. Texture streaming is a means of using data streams 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. As an optimization, it is possible to render detail from a complex, high-resolution model or expensive process (such as global illumination) into a surface texture (possibly on a low-resolution model). This technique is called baking (or render mapping) and 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) have used this technique. The original Quake software engine used on-the-fly baking to combine light maps and colour maps in a process called 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 linearly interpolates texture coordinates across a surface, making it the fastest form of texture mapping. Some software and hardware (such as the original PlayStation) project 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 or by an incremental error algorithm akin to Bresenham's line algorithm. In contrast to perpendicular polygons, this leads to noticeable distortion with perspective transformations (as shown in the figure: the checker box texture appears bent), especially as primitives near the camera. This distortion can be reduced by subdividing polygons into smaller polygons. Using quad primitives for rectangular objects can look less incorrect than if those rectangles were split into triangles. However, since interpolating four 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, offered efficient quad primitives. With perspective correction, triangles become equivalent to quad primitives 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. Affine linear interpolation across that horizontal span will look correct because every pixel along that line is the same distance from the viewer. Perspective correct texturing accounts for the vertices' positions in 3D space rather than simply interpolating coordinates in 2D screen space. While achieving the correct visual effect, perspective correct texturing is more expensive to calculate. To perform perspective correction of the texture coordinates u {\displaystyle u} and v {\displaystyle v} , with z {\displaystyle z} being the depth component from the viewer's point of view, it is possible to take advantage of the fact that the values 1 z {\displaystyle {\frac {1}{z}}} , u z {\displaystyle {\frac {u}{z}}} , and v z {\displaystyle {\frac {v}{z}}} are linear in screen space across the surface being textured. In contrast, the original z {\displaystyle z} , u {\displaystyle u} , and v {\displaystyle v} , before the division, are not linear across the surface in screen space. It is therefore possible to linearly interpolate these reciprocals across the surface, computing corrected values at each pixel, to produce a perspective correct texture mapping. To do this, the reciprocals at each vertex of the geometry (three points for a triangle) are calculated. Vertex n {\displaystyle n} has reciprocals u n z n {\displaystyle {\frac {u_{n}}{z_{n}}}} , v n z n {\displaystyle {\frac {v_{n}}{z_{n}}}} , and 1 z n {\displaystyle {\frac {1}{z_{n}}}} . Then, linear interpolation can be done on these reciprocals between the n {\displaystyle 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 {\displaystyle u_{i},v_{i}} and 1 z i {\displaystyle {\frac {1}{z_{i}}}} (reciprocal z i {\displaystyle z_{i}} ). However, as our division by z {\displaystyle z} altered their coordinate system, this u i , v i {\displaystyle u_{i},v_{i}} cannot be used as texture coordinates. To correct back to the u , v {\displaystyle u,v} space, the corrected z {\displaystyle z} is calculated by taking the reciprocal once again: z c o r r e c t = 1 1 z i {\displaystyle z_{correct}={\frac {1}{\frac {1}{z_{i}}}}} . This is then used to correct the u i , v i {\displaystyle u_{i},v_{i}} coordinates: u c o r r e c t = u i ⋅ z i {\displaystyle u_{correct}=u_{i}\cdot z_{i}} and v c o r r e c t = v i ⋅ z i {\displaystyle v_{correct}=v_{i}\cdot z_{i}} . This correction makes it so that the difference from pixel to pixel between texture coordinates is smaller in parts of the polygon that are closer to the viewer (stretching the texture wider) and is larger in parts that are farther away (compressing the texture). Affine texture mapping directly interpolates a texture coordinate u α {\displaystyle u_{\alpha }} between two endpoints u 0 {\displaystyle u_{0}} and u 1 {\displaystyle u_{1}} : u α = ( 1 − α ) u 0 + α u 1 {\displaystyle u_{\alpha }=(1-\alpha )u_{0}+\alpha u_{1}} where 0 ≤ α ≤ 1 {\displaystyle 0\leq \alpha \leq 1} . Perspective correct mapping interpolates after dividing by depth z {\displaystyle z} , then uses its interpolated reciprocal to recover the correct coordinate: u α = ( 1 − α ) u 0 z 0 + α u 1 z 1 ( 1 − α ) 1 z 0 + α 1 z 1 {\displaystyle u_{\alpha }={\frac {(1-\alpha ){\frac {u_{0}}{z_{0}}}+\alpha {\frac {u_{1}}{z_{1}}}}{(1-\alpha ){\frac {1}{z_{0}}}+\alpha {\frac {1}{z_{1}}}}}} 3D graphics hardware typically supports perspective correct texturing. Various techniques have evolved for rendering texture mapped geometry into images with different quality and precision trade-offs, which can be applied to both software and hardware. Classic software texture mappers generally only performed simple texture mapping with one lighting effect at most (typically applied through a lookup table), and the perspective correctness was about 16 times more expensive.[compared to?] The Doom engine restricted the world to vertical walls and horizontal floors and 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 and 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 which allowed the appearance of greater freedom while using the same rendering technique. Some engines were able to render texture mapped heightmaps (e.g. Nova Logic'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. Every triangle can be further subdivided into groups of about 16 pixels in order to achieve two goals: keeping the arithmetic mill busy at all times and producing faster arithmetic results.[vague] 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 made extensive use of this because it only supported affine mapping in hardware and had a relatively high triangle throughput compared to its peers. Software renderers generally prefer 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), thus lessening the overhead further. Another reason is that affine texture mapping does not fit into the low number of CPU registers of the x86 CPU; the 68000 and RISC processors are much more suited for that approach. 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. As the polygons are rendered independently, 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.[original research?] One other technique is to approximate the perspective with a faster calculation, such as a polynomial. A second uses the 1 z i {\textstyle {\frac {1}{z_{i}}}} value of the last two drawn pixels to linearly extrapolate the next value. For the latter, the division is then done starting from those values so that all that has to be divided is a small remainder. However, the amount of bookkeeping needed makes this technique too slow on most systems.[citation needed] A third technique, used by the Build Engine (used, most notably, in Duke Nukem 3D), builds on the constant distance trick used by the Doom engine by finding and rendering along the line of constant distance for arbitrary polygons. 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) and broadcast digital video effects machines such as the Ampex ADO. Texture mapping hardware later appeared in arcade cabinets, consumer video game consoles, and PC video cards in the mid-1990s. In flight simulations, texture mapping provided important motion and altitude cues necessary for pilot training not available on untextured surfaces. Additionally, texture mapping was implemented so that real-time processing of prefiltered texture patterns stored in memory could be accessed by the video processor in real-time. Modern graphics processing units (GPUs) provide specialised fixed function units called texture samplers, or texture mapping units, to perform texture mapping, usually with trilinear filtering or better multi-tap anisotropic filtering 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 implementations combine texture mapping with hidden-surface determination in tile-based deferred rendering or scanline rendering; such systems only fetch the visible texels at the expense of using greater workspace for transformed vertices. Most systems have settled on the z-buffering approach, which can still reduce the texture mapping workload with front-to-back sorting. On earlier graphics hardware, there were two competing paradigms of how to deliver a texture to the screen: Of these methods, inverse texture mapping has become standard in modern hardware. 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 of this method 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 is that the memory access pattern in the texture space 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 texture mapping, but can also be adapted for perspective correctness. 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. This was used by some hardware, such as the 3DO, the Sega Saturn 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 the § Affine texture mapping section above). The NV1 hardware also allowed a quadratic interpolation mode to provide an even better approximation of perspective correctness. UV mapping became an important technique for 3D modelling and assisted in clipping the texture correctly when the primitive went past the edge of the screen, but existing hardware did not provide effective implementations of this. These shortcomings could have been addressed with further development, but GPU design has mostly shifted toward using the inverse mapping technique. Applications Beyond 3D rendering, the availability of texture mapping hardware has inspired its use for accelerating other tasks: It is possible to use texture mapping hardware to accelerate both the reconstruction of voxel data sets from tomographic scans, and to visualize the results. Many user interfaces use texture mapping to accelerate animated transitions of screen elements, e.g. Exposé in Mac OS X. See also References Software External links
========================================
[SOURCE: https://en.wikipedia.org/wiki/Texture_mapping#See_also] | [TOKENS: 4408]
Contents Texture mapping 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 apart so that it can be unfolded into a 2D coordinate space (UV space). Semantic Texture mapping can multiply refer to (1) the task of unwrapping a 3D model (converting the surface of a 3D model into a 2D texture map), (2) applying a 2D texture map onto the surface of a 3D model, and (3) the 3D software algorithm that performs both tasks. A texture map refers to a 2D image ("texture") that adds visual detail to a 3D model. The image can be stored as a raster graphic. A texture that stores a specific property—such as bumpiness, reflectivity, or transparency—is also referred to as a color map or roughness map. The coordinate space that converts from a 3D model's 3D space into a 2D space for sampling from the texture map is variously called UV space, UV coordinates, or texture space. Algorithm The following is a simplified explanation of how an algorithm could work to render an image: History The original technique was pioneered by Edwin Catmull in 1974 as part of his doctoral thesis. Texture mapping originally referred to diffuse mapping, a method that simply mapped pixels from a texture to a 3D surface ("wrapping" the image around the object). In recent decades, the advent of multi-pass rendering, multitexturing, mipmaps, and more complex mappings such as height mapping, bump mapping, normal mapping, displacement mapping, reflection mapping, specular mapping, occlusion mapping, and many other variations on the technique (controlled by a materials system) have made it possible to simulate near-photorealism in real time by vastly reducing the number of polygons and lighting calculations needed to construct a realistic and functional 3D scene. Texture maps A texture map is an image applied ("mapped") to the surface of a shape or polygon. This may be a bitmap image or a procedural texture. They may be stored in common image file formats, referenced by 3D model formats or material definitions, and assembled into resource bundles. 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. 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. Texture maps usually contain RGB color data (either stored as direct color, compressed formats, or indexed color), and sometimes an additional channel for alpha blending (RGBA) especially for billboards and decal overlay textures. It is possible to use the alpha channel (which may be convenient to store in formats parsed by hardware) for other uses such as specularity. Multiple texture maps (or channels) may be combined for control over specularity, normals, displacement, or subsurface scattering, 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 textures with multiple faces for environment mapping. Texture maps may be acquired by scanning or digital photography, designed in image manipulation software such as GIMP or Photoshop, or painted onto 3D surfaces directly in a 3D paint tool such as Mudbox or ZBrush. 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. This might be accomplished via planar projection or, alternatively, cylindrical or spherical 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" mapping from every piece of a surface (which is important for render mapping and light mapping, also known as baking). Texture mapping maps the model surface (or screen space 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 may be performed approximately by texture-space operations. Multitexturing is the use of more than one texture at a time on a polygon. For instance, a light map 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 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, for greater fidelity. Another multitexture technique is bump mapping, 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 video games, as graphics hardware has become powerful enough to accommodate it in real-time. The way that samples (e.g. when viewed as pixels on the screen) are calculated from the texels (texture pixels) is governed by texture filtering. The cheapest method is to use the nearest-neighbour interpolation, but bilinear interpolation or trilinear interpolation between mipmaps are two commonly used alternatives which reduce aliasing or jaggies. In the event of a texture coordinate being outside the texture, it is either clamped or wrapped. Anisotropic filtering better eliminates directional artefacts when viewing textures from oblique viewing angles. Texture streaming is a means of using data streams 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. As an optimization, it is possible to render detail from a complex, high-resolution model or expensive process (such as global illumination) into a surface texture (possibly on a low-resolution model). This technique is called baking (or render mapping) and 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) have used this technique. The original Quake software engine used on-the-fly baking to combine light maps and colour maps in a process called 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 linearly interpolates texture coordinates across a surface, making it the fastest form of texture mapping. Some software and hardware (such as the original PlayStation) project 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 or by an incremental error algorithm akin to Bresenham's line algorithm. In contrast to perpendicular polygons, this leads to noticeable distortion with perspective transformations (as shown in the figure: the checker box texture appears bent), especially as primitives near the camera. This distortion can be reduced by subdividing polygons into smaller polygons. Using quad primitives for rectangular objects can look less incorrect than if those rectangles were split into triangles. However, since interpolating four 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, offered efficient quad primitives. With perspective correction, triangles become equivalent to quad primitives 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. Affine linear interpolation across that horizontal span will look correct because every pixel along that line is the same distance from the viewer. Perspective correct texturing accounts for the vertices' positions in 3D space rather than simply interpolating coordinates in 2D screen space. While achieving the correct visual effect, perspective correct texturing is more expensive to calculate. To perform perspective correction of the texture coordinates u {\displaystyle u} and v {\displaystyle v} , with z {\displaystyle z} being the depth component from the viewer's point of view, it is possible to take advantage of the fact that the values 1 z {\displaystyle {\frac {1}{z}}} , u z {\displaystyle {\frac {u}{z}}} , and v z {\displaystyle {\frac {v}{z}}} are linear in screen space across the surface being textured. In contrast, the original z {\displaystyle z} , u {\displaystyle u} , and v {\displaystyle v} , before the division, are not linear across the surface in screen space. It is therefore possible to linearly interpolate these reciprocals across the surface, computing corrected values at each pixel, to produce a perspective correct texture mapping. To do this, the reciprocals at each vertex of the geometry (three points for a triangle) are calculated. Vertex n {\displaystyle n} has reciprocals u n z n {\displaystyle {\frac {u_{n}}{z_{n}}}} , v n z n {\displaystyle {\frac {v_{n}}{z_{n}}}} , and 1 z n {\displaystyle {\frac {1}{z_{n}}}} . Then, linear interpolation can be done on these reciprocals between the n {\displaystyle 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 {\displaystyle u_{i},v_{i}} and 1 z i {\displaystyle {\frac {1}{z_{i}}}} (reciprocal z i {\displaystyle z_{i}} ). However, as our division by z {\displaystyle z} altered their coordinate system, this u i , v i {\displaystyle u_{i},v_{i}} cannot be used as texture coordinates. To correct back to the u , v {\displaystyle u,v} space, the corrected z {\displaystyle z} is calculated by taking the reciprocal once again: z c o r r e c t = 1 1 z i {\displaystyle z_{correct}={\frac {1}{\frac {1}{z_{i}}}}} . This is then used to correct the u i , v i {\displaystyle u_{i},v_{i}} coordinates: u c o r r e c t = u i ⋅ z i {\displaystyle u_{correct}=u_{i}\cdot z_{i}} and v c o r r e c t = v i ⋅ z i {\displaystyle v_{correct}=v_{i}\cdot z_{i}} . This correction makes it so that the difference from pixel to pixel between texture coordinates is smaller in parts of the polygon that are closer to the viewer (stretching the texture wider) and is larger in parts that are farther away (compressing the texture). Affine texture mapping directly interpolates a texture coordinate u α {\displaystyle u_{\alpha }} between two endpoints u 0 {\displaystyle u_{0}} and u 1 {\displaystyle u_{1}} : u α = ( 1 − α ) u 0 + α u 1 {\displaystyle u_{\alpha }=(1-\alpha )u_{0}+\alpha u_{1}} where 0 ≤ α ≤ 1 {\displaystyle 0\leq \alpha \leq 1} . Perspective correct mapping interpolates after dividing by depth z {\displaystyle z} , then uses its interpolated reciprocal to recover the correct coordinate: u α = ( 1 − α ) u 0 z 0 + α u 1 z 1 ( 1 − α ) 1 z 0 + α 1 z 1 {\displaystyle u_{\alpha }={\frac {(1-\alpha ){\frac {u_{0}}{z_{0}}}+\alpha {\frac {u_{1}}{z_{1}}}}{(1-\alpha ){\frac {1}{z_{0}}}+\alpha {\frac {1}{z_{1}}}}}} 3D graphics hardware typically supports perspective correct texturing. Various techniques have evolved for rendering texture mapped geometry into images with different quality and precision trade-offs, which can be applied to both software and hardware. Classic software texture mappers generally only performed simple texture mapping with one lighting effect at most (typically applied through a lookup table), and the perspective correctness was about 16 times more expensive.[compared to?] The Doom engine restricted the world to vertical walls and horizontal floors and 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 and 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 which allowed the appearance of greater freedom while using the same rendering technique. Some engines were able to render texture mapped heightmaps (e.g. Nova Logic'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. Every triangle can be further subdivided into groups of about 16 pixels in order to achieve two goals: keeping the arithmetic mill busy at all times and producing faster arithmetic results.[vague] 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 made extensive use of this because it only supported affine mapping in hardware and had a relatively high triangle throughput compared to its peers. Software renderers generally prefer 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), thus lessening the overhead further. Another reason is that affine texture mapping does not fit into the low number of CPU registers of the x86 CPU; the 68000 and RISC processors are much more suited for that approach. 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. As the polygons are rendered independently, 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.[original research?] One other technique is to approximate the perspective with a faster calculation, such as a polynomial. A second uses the 1 z i {\textstyle {\frac {1}{z_{i}}}} value of the last two drawn pixels to linearly extrapolate the next value. For the latter, the division is then done starting from those values so that all that has to be divided is a small remainder. However, the amount of bookkeeping needed makes this technique too slow on most systems.[citation needed] A third technique, used by the Build Engine (used, most notably, in Duke Nukem 3D), builds on the constant distance trick used by the Doom engine by finding and rendering along the line of constant distance for arbitrary polygons. 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) and broadcast digital video effects machines such as the Ampex ADO. Texture mapping hardware later appeared in arcade cabinets, consumer video game consoles, and PC video cards in the mid-1990s. In flight simulations, texture mapping provided important motion and altitude cues necessary for pilot training not available on untextured surfaces. Additionally, texture mapping was implemented so that real-time processing of prefiltered texture patterns stored in memory could be accessed by the video processor in real-time. Modern graphics processing units (GPUs) provide specialised fixed function units called texture samplers, or texture mapping units, to perform texture mapping, usually with trilinear filtering or better multi-tap anisotropic filtering 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 implementations combine texture mapping with hidden-surface determination in tile-based deferred rendering or scanline rendering; such systems only fetch the visible texels at the expense of using greater workspace for transformed vertices. Most systems have settled on the z-buffering approach, which can still reduce the texture mapping workload with front-to-back sorting. On earlier graphics hardware, there were two competing paradigms of how to deliver a texture to the screen: Of these methods, inverse texture mapping has become standard in modern hardware. 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 of this method 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 is that the memory access pattern in the texture space 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 texture mapping, but can also be adapted for perspective correctness. 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. This was used by some hardware, such as the 3DO, the Sega Saturn 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 the § Affine texture mapping section above). The NV1 hardware also allowed a quadratic interpolation mode to provide an even better approximation of perspective correctness. UV mapping became an important technique for 3D modelling and assisted in clipping the texture correctly when the primitive went past the edge of the screen, but existing hardware did not provide effective implementations of this. These shortcomings could have been addressed with further development, but GPU design has mostly shifted toward using the inverse mapping technique. Applications Beyond 3D rendering, the availability of texture mapping hardware has inspired its use for accelerating other tasks: It is possible to use texture mapping hardware to accelerate both the reconstruction of voxel data sets from tomographic scans, and to visualize the results. Many user interfaces use texture mapping to accelerate animated transitions of screen elements, e.g. Exposé in Mac OS X. See also References Software External links
========================================
[SOURCE: https://en.wikipedia.org/wiki/Texture_mapping#References] | [TOKENS: 4408]
Contents Texture mapping 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 apart so that it can be unfolded into a 2D coordinate space (UV space). Semantic Texture mapping can multiply refer to (1) the task of unwrapping a 3D model (converting the surface of a 3D model into a 2D texture map), (2) applying a 2D texture map onto the surface of a 3D model, and (3) the 3D software algorithm that performs both tasks. A texture map refers to a 2D image ("texture") that adds visual detail to a 3D model. The image can be stored as a raster graphic. A texture that stores a specific property—such as bumpiness, reflectivity, or transparency—is also referred to as a color map or roughness map. The coordinate space that converts from a 3D model's 3D space into a 2D space for sampling from the texture map is variously called UV space, UV coordinates, or texture space. Algorithm The following is a simplified explanation of how an algorithm could work to render an image: History The original technique was pioneered by Edwin Catmull in 1974 as part of his doctoral thesis. Texture mapping originally referred to diffuse mapping, a method that simply mapped pixels from a texture to a 3D surface ("wrapping" the image around the object). In recent decades, the advent of multi-pass rendering, multitexturing, mipmaps, and more complex mappings such as height mapping, bump mapping, normal mapping, displacement mapping, reflection mapping, specular mapping, occlusion mapping, and many other variations on the technique (controlled by a materials system) have made it possible to simulate near-photorealism in real time by vastly reducing the number of polygons and lighting calculations needed to construct a realistic and functional 3D scene. Texture maps A texture map is an image applied ("mapped") to the surface of a shape or polygon. This may be a bitmap image or a procedural texture. They may be stored in common image file formats, referenced by 3D model formats or material definitions, and assembled into resource bundles. 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. 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. Texture maps usually contain RGB color data (either stored as direct color, compressed formats, or indexed color), and sometimes an additional channel for alpha blending (RGBA) especially for billboards and decal overlay textures. It is possible to use the alpha channel (which may be convenient to store in formats parsed by hardware) for other uses such as specularity. Multiple texture maps (or channels) may be combined for control over specularity, normals, displacement, or subsurface scattering, 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 textures with multiple faces for environment mapping. Texture maps may be acquired by scanning or digital photography, designed in image manipulation software such as GIMP or Photoshop, or painted onto 3D surfaces directly in a 3D paint tool such as Mudbox or ZBrush. 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. This might be accomplished via planar projection or, alternatively, cylindrical or spherical 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" mapping from every piece of a surface (which is important for render mapping and light mapping, also known as baking). Texture mapping maps the model surface (or screen space 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 may be performed approximately by texture-space operations. Multitexturing is the use of more than one texture at a time on a polygon. For instance, a light map 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 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, for greater fidelity. Another multitexture technique is bump mapping, 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 video games, as graphics hardware has become powerful enough to accommodate it in real-time. The way that samples (e.g. when viewed as pixels on the screen) are calculated from the texels (texture pixels) is governed by texture filtering. The cheapest method is to use the nearest-neighbour interpolation, but bilinear interpolation or trilinear interpolation between mipmaps are two commonly used alternatives which reduce aliasing or jaggies. In the event of a texture coordinate being outside the texture, it is either clamped or wrapped. Anisotropic filtering better eliminates directional artefacts when viewing textures from oblique viewing angles. Texture streaming is a means of using data streams 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. As an optimization, it is possible to render detail from a complex, high-resolution model or expensive process (such as global illumination) into a surface texture (possibly on a low-resolution model). This technique is called baking (or render mapping) and 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) have used this technique. The original Quake software engine used on-the-fly baking to combine light maps and colour maps in a process called 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 linearly interpolates texture coordinates across a surface, making it the fastest form of texture mapping. Some software and hardware (such as the original PlayStation) project 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 or by an incremental error algorithm akin to Bresenham's line algorithm. In contrast to perpendicular polygons, this leads to noticeable distortion with perspective transformations (as shown in the figure: the checker box texture appears bent), especially as primitives near the camera. This distortion can be reduced by subdividing polygons into smaller polygons. Using quad primitives for rectangular objects can look less incorrect than if those rectangles were split into triangles. However, since interpolating four 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, offered efficient quad primitives. With perspective correction, triangles become equivalent to quad primitives 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. Affine linear interpolation across that horizontal span will look correct because every pixel along that line is the same distance from the viewer. Perspective correct texturing accounts for the vertices' positions in 3D space rather than simply interpolating coordinates in 2D screen space. While achieving the correct visual effect, perspective correct texturing is more expensive to calculate. To perform perspective correction of the texture coordinates u {\displaystyle u} and v {\displaystyle v} , with z {\displaystyle z} being the depth component from the viewer's point of view, it is possible to take advantage of the fact that the values 1 z {\displaystyle {\frac {1}{z}}} , u z {\displaystyle {\frac {u}{z}}} , and v z {\displaystyle {\frac {v}{z}}} are linear in screen space across the surface being textured. In contrast, the original z {\displaystyle z} , u {\displaystyle u} , and v {\displaystyle v} , before the division, are not linear across the surface in screen space. It is therefore possible to linearly interpolate these reciprocals across the surface, computing corrected values at each pixel, to produce a perspective correct texture mapping. To do this, the reciprocals at each vertex of the geometry (three points for a triangle) are calculated. Vertex n {\displaystyle n} has reciprocals u n z n {\displaystyle {\frac {u_{n}}{z_{n}}}} , v n z n {\displaystyle {\frac {v_{n}}{z_{n}}}} , and 1 z n {\displaystyle {\frac {1}{z_{n}}}} . Then, linear interpolation can be done on these reciprocals between the n {\displaystyle 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 {\displaystyle u_{i},v_{i}} and 1 z i {\displaystyle {\frac {1}{z_{i}}}} (reciprocal z i {\displaystyle z_{i}} ). However, as our division by z {\displaystyle z} altered their coordinate system, this u i , v i {\displaystyle u_{i},v_{i}} cannot be used as texture coordinates. To correct back to the u , v {\displaystyle u,v} space, the corrected z {\displaystyle z} is calculated by taking the reciprocal once again: z c o r r e c t = 1 1 z i {\displaystyle z_{correct}={\frac {1}{\frac {1}{z_{i}}}}} . This is then used to correct the u i , v i {\displaystyle u_{i},v_{i}} coordinates: u c o r r e c t = u i ⋅ z i {\displaystyle u_{correct}=u_{i}\cdot z_{i}} and v c o r r e c t = v i ⋅ z i {\displaystyle v_{correct}=v_{i}\cdot z_{i}} . This correction makes it so that the difference from pixel to pixel between texture coordinates is smaller in parts of the polygon that are closer to the viewer (stretching the texture wider) and is larger in parts that are farther away (compressing the texture). Affine texture mapping directly interpolates a texture coordinate u α {\displaystyle u_{\alpha }} between two endpoints u 0 {\displaystyle u_{0}} and u 1 {\displaystyle u_{1}} : u α = ( 1 − α ) u 0 + α u 1 {\displaystyle u_{\alpha }=(1-\alpha )u_{0}+\alpha u_{1}} where 0 ≤ α ≤ 1 {\displaystyle 0\leq \alpha \leq 1} . Perspective correct mapping interpolates after dividing by depth z {\displaystyle z} , then uses its interpolated reciprocal to recover the correct coordinate: u α = ( 1 − α ) u 0 z 0 + α u 1 z 1 ( 1 − α ) 1 z 0 + α 1 z 1 {\displaystyle u_{\alpha }={\frac {(1-\alpha ){\frac {u_{0}}{z_{0}}}+\alpha {\frac {u_{1}}{z_{1}}}}{(1-\alpha ){\frac {1}{z_{0}}}+\alpha {\frac {1}{z_{1}}}}}} 3D graphics hardware typically supports perspective correct texturing. Various techniques have evolved for rendering texture mapped geometry into images with different quality and precision trade-offs, which can be applied to both software and hardware. Classic software texture mappers generally only performed simple texture mapping with one lighting effect at most (typically applied through a lookup table), and the perspective correctness was about 16 times more expensive.[compared to?] The Doom engine restricted the world to vertical walls and horizontal floors and 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 and 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 which allowed the appearance of greater freedom while using the same rendering technique. Some engines were able to render texture mapped heightmaps (e.g. Nova Logic'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. Every triangle can be further subdivided into groups of about 16 pixels in order to achieve two goals: keeping the arithmetic mill busy at all times and producing faster arithmetic results.[vague] 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 made extensive use of this because it only supported affine mapping in hardware and had a relatively high triangle throughput compared to its peers. Software renderers generally prefer 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), thus lessening the overhead further. Another reason is that affine texture mapping does not fit into the low number of CPU registers of the x86 CPU; the 68000 and RISC processors are much more suited for that approach. 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. As the polygons are rendered independently, 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.[original research?] One other technique is to approximate the perspective with a faster calculation, such as a polynomial. A second uses the 1 z i {\textstyle {\frac {1}{z_{i}}}} value of the last two drawn pixels to linearly extrapolate the next value. For the latter, the division is then done starting from those values so that all that has to be divided is a small remainder. However, the amount of bookkeeping needed makes this technique too slow on most systems.[citation needed] A third technique, used by the Build Engine (used, most notably, in Duke Nukem 3D), builds on the constant distance trick used by the Doom engine by finding and rendering along the line of constant distance for arbitrary polygons. 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) and broadcast digital video effects machines such as the Ampex ADO. Texture mapping hardware later appeared in arcade cabinets, consumer video game consoles, and PC video cards in the mid-1990s. In flight simulations, texture mapping provided important motion and altitude cues necessary for pilot training not available on untextured surfaces. Additionally, texture mapping was implemented so that real-time processing of prefiltered texture patterns stored in memory could be accessed by the video processor in real-time. Modern graphics processing units (GPUs) provide specialised fixed function units called texture samplers, or texture mapping units, to perform texture mapping, usually with trilinear filtering or better multi-tap anisotropic filtering 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 implementations combine texture mapping with hidden-surface determination in tile-based deferred rendering or scanline rendering; such systems only fetch the visible texels at the expense of using greater workspace for transformed vertices. Most systems have settled on the z-buffering approach, which can still reduce the texture mapping workload with front-to-back sorting. On earlier graphics hardware, there were two competing paradigms of how to deliver a texture to the screen: Of these methods, inverse texture mapping has become standard in modern hardware. 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 of this method 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 is that the memory access pattern in the texture space 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 texture mapping, but can also be adapted for perspective correctness. 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. This was used by some hardware, such as the 3DO, the Sega Saturn 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 the § Affine texture mapping section above). The NV1 hardware also allowed a quadratic interpolation mode to provide an even better approximation of perspective correctness. UV mapping became an important technique for 3D modelling and assisted in clipping the texture correctly when the primitive went past the edge of the screen, but existing hardware did not provide effective implementations of this. These shortcomings could have been addressed with further development, but GPU design has mostly shifted toward using the inverse mapping technique. Applications Beyond 3D rendering, the availability of texture mapping hardware has inspired its use for accelerating other tasks: It is possible to use texture mapping hardware to accelerate both the reconstruction of voxel data sets from tomographic scans, and to visualize the results. Many user interfaces use texture mapping to accelerate animated transitions of screen elements, e.g. Exposé in Mac OS X. See also References Software External links
========================================
[SOURCE: https://en.wikipedia.org/wiki/Texture_mapping#Software] | [TOKENS: 4408]
Contents Texture mapping 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 apart so that it can be unfolded into a 2D coordinate space (UV space). Semantic Texture mapping can multiply refer to (1) the task of unwrapping a 3D model (converting the surface of a 3D model into a 2D texture map), (2) applying a 2D texture map onto the surface of a 3D model, and (3) the 3D software algorithm that performs both tasks. A texture map refers to a 2D image ("texture") that adds visual detail to a 3D model. The image can be stored as a raster graphic. A texture that stores a specific property—such as bumpiness, reflectivity, or transparency—is also referred to as a color map or roughness map. The coordinate space that converts from a 3D model's 3D space into a 2D space for sampling from the texture map is variously called UV space, UV coordinates, or texture space. Algorithm The following is a simplified explanation of how an algorithm could work to render an image: History The original technique was pioneered by Edwin Catmull in 1974 as part of his doctoral thesis. Texture mapping originally referred to diffuse mapping, a method that simply mapped pixels from a texture to a 3D surface ("wrapping" the image around the object). In recent decades, the advent of multi-pass rendering, multitexturing, mipmaps, and more complex mappings such as height mapping, bump mapping, normal mapping, displacement mapping, reflection mapping, specular mapping, occlusion mapping, and many other variations on the technique (controlled by a materials system) have made it possible to simulate near-photorealism in real time by vastly reducing the number of polygons and lighting calculations needed to construct a realistic and functional 3D scene. Texture maps A texture map is an image applied ("mapped") to the surface of a shape or polygon. This may be a bitmap image or a procedural texture. They may be stored in common image file formats, referenced by 3D model formats or material definitions, and assembled into resource bundles. 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. 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. Texture maps usually contain RGB color data (either stored as direct color, compressed formats, or indexed color), and sometimes an additional channel for alpha blending (RGBA) especially for billboards and decal overlay textures. It is possible to use the alpha channel (which may be convenient to store in formats parsed by hardware) for other uses such as specularity. Multiple texture maps (or channels) may be combined for control over specularity, normals, displacement, or subsurface scattering, 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 textures with multiple faces for environment mapping. Texture maps may be acquired by scanning or digital photography, designed in image manipulation software such as GIMP or Photoshop, or painted onto 3D surfaces directly in a 3D paint tool such as Mudbox or ZBrush. 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. This might be accomplished via planar projection or, alternatively, cylindrical or spherical 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" mapping from every piece of a surface (which is important for render mapping and light mapping, also known as baking). Texture mapping maps the model surface (or screen space 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 may be performed approximately by texture-space operations. Multitexturing is the use of more than one texture at a time on a polygon. For instance, a light map 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 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, for greater fidelity. Another multitexture technique is bump mapping, 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 video games, as graphics hardware has become powerful enough to accommodate it in real-time. The way that samples (e.g. when viewed as pixels on the screen) are calculated from the texels (texture pixels) is governed by texture filtering. The cheapest method is to use the nearest-neighbour interpolation, but bilinear interpolation or trilinear interpolation between mipmaps are two commonly used alternatives which reduce aliasing or jaggies. In the event of a texture coordinate being outside the texture, it is either clamped or wrapped. Anisotropic filtering better eliminates directional artefacts when viewing textures from oblique viewing angles. Texture streaming is a means of using data streams 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. As an optimization, it is possible to render detail from a complex, high-resolution model or expensive process (such as global illumination) into a surface texture (possibly on a low-resolution model). This technique is called baking (or render mapping) and 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) have used this technique. The original Quake software engine used on-the-fly baking to combine light maps and colour maps in a process called 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 linearly interpolates texture coordinates across a surface, making it the fastest form of texture mapping. Some software and hardware (such as the original PlayStation) project 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 or by an incremental error algorithm akin to Bresenham's line algorithm. In contrast to perpendicular polygons, this leads to noticeable distortion with perspective transformations (as shown in the figure: the checker box texture appears bent), especially as primitives near the camera. This distortion can be reduced by subdividing polygons into smaller polygons. Using quad primitives for rectangular objects can look less incorrect than if those rectangles were split into triangles. However, since interpolating four 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, offered efficient quad primitives. With perspective correction, triangles become equivalent to quad primitives 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. Affine linear interpolation across that horizontal span will look correct because every pixel along that line is the same distance from the viewer. Perspective correct texturing accounts for the vertices' positions in 3D space rather than simply interpolating coordinates in 2D screen space. While achieving the correct visual effect, perspective correct texturing is more expensive to calculate. To perform perspective correction of the texture coordinates u {\displaystyle u} and v {\displaystyle v} , with z {\displaystyle z} being the depth component from the viewer's point of view, it is possible to take advantage of the fact that the values 1 z {\displaystyle {\frac {1}{z}}} , u z {\displaystyle {\frac {u}{z}}} , and v z {\displaystyle {\frac {v}{z}}} are linear in screen space across the surface being textured. In contrast, the original z {\displaystyle z} , u {\displaystyle u} , and v {\displaystyle v} , before the division, are not linear across the surface in screen space. It is therefore possible to linearly interpolate these reciprocals across the surface, computing corrected values at each pixel, to produce a perspective correct texture mapping. To do this, the reciprocals at each vertex of the geometry (three points for a triangle) are calculated. Vertex n {\displaystyle n} has reciprocals u n z n {\displaystyle {\frac {u_{n}}{z_{n}}}} , v n z n {\displaystyle {\frac {v_{n}}{z_{n}}}} , and 1 z n {\displaystyle {\frac {1}{z_{n}}}} . Then, linear interpolation can be done on these reciprocals between the n {\displaystyle 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 {\displaystyle u_{i},v_{i}} and 1 z i {\displaystyle {\frac {1}{z_{i}}}} (reciprocal z i {\displaystyle z_{i}} ). However, as our division by z {\displaystyle z} altered their coordinate system, this u i , v i {\displaystyle u_{i},v_{i}} cannot be used as texture coordinates. To correct back to the u , v {\displaystyle u,v} space, the corrected z {\displaystyle z} is calculated by taking the reciprocal once again: z c o r r e c t = 1 1 z i {\displaystyle z_{correct}={\frac {1}{\frac {1}{z_{i}}}}} . This is then used to correct the u i , v i {\displaystyle u_{i},v_{i}} coordinates: u c o r r e c t = u i ⋅ z i {\displaystyle u_{correct}=u_{i}\cdot z_{i}} and v c o r r e c t = v i ⋅ z i {\displaystyle v_{correct}=v_{i}\cdot z_{i}} . This correction makes it so that the difference from pixel to pixel between texture coordinates is smaller in parts of the polygon that are closer to the viewer (stretching the texture wider) and is larger in parts that are farther away (compressing the texture). Affine texture mapping directly interpolates a texture coordinate u α {\displaystyle u_{\alpha }} between two endpoints u 0 {\displaystyle u_{0}} and u 1 {\displaystyle u_{1}} : u α = ( 1 − α ) u 0 + α u 1 {\displaystyle u_{\alpha }=(1-\alpha )u_{0}+\alpha u_{1}} where 0 ≤ α ≤ 1 {\displaystyle 0\leq \alpha \leq 1} . Perspective correct mapping interpolates after dividing by depth z {\displaystyle z} , then uses its interpolated reciprocal to recover the correct coordinate: u α = ( 1 − α ) u 0 z 0 + α u 1 z 1 ( 1 − α ) 1 z 0 + α 1 z 1 {\displaystyle u_{\alpha }={\frac {(1-\alpha ){\frac {u_{0}}{z_{0}}}+\alpha {\frac {u_{1}}{z_{1}}}}{(1-\alpha ){\frac {1}{z_{0}}}+\alpha {\frac {1}{z_{1}}}}}} 3D graphics hardware typically supports perspective correct texturing. Various techniques have evolved for rendering texture mapped geometry into images with different quality and precision trade-offs, which can be applied to both software and hardware. Classic software texture mappers generally only performed simple texture mapping with one lighting effect at most (typically applied through a lookup table), and the perspective correctness was about 16 times more expensive.[compared to?] The Doom engine restricted the world to vertical walls and horizontal floors and 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 and 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 which allowed the appearance of greater freedom while using the same rendering technique. Some engines were able to render texture mapped heightmaps (e.g. Nova Logic'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. Every triangle can be further subdivided into groups of about 16 pixels in order to achieve two goals: keeping the arithmetic mill busy at all times and producing faster arithmetic results.[vague] 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 made extensive use of this because it only supported affine mapping in hardware and had a relatively high triangle throughput compared to its peers. Software renderers generally prefer 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), thus lessening the overhead further. Another reason is that affine texture mapping does not fit into the low number of CPU registers of the x86 CPU; the 68000 and RISC processors are much more suited for that approach. 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. As the polygons are rendered independently, 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.[original research?] One other technique is to approximate the perspective with a faster calculation, such as a polynomial. A second uses the 1 z i {\textstyle {\frac {1}{z_{i}}}} value of the last two drawn pixels to linearly extrapolate the next value. For the latter, the division is then done starting from those values so that all that has to be divided is a small remainder. However, the amount of bookkeeping needed makes this technique too slow on most systems.[citation needed] A third technique, used by the Build Engine (used, most notably, in Duke Nukem 3D), builds on the constant distance trick used by the Doom engine by finding and rendering along the line of constant distance for arbitrary polygons. 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) and broadcast digital video effects machines such as the Ampex ADO. Texture mapping hardware later appeared in arcade cabinets, consumer video game consoles, and PC video cards in the mid-1990s. In flight simulations, texture mapping provided important motion and altitude cues necessary for pilot training not available on untextured surfaces. Additionally, texture mapping was implemented so that real-time processing of prefiltered texture patterns stored in memory could be accessed by the video processor in real-time. Modern graphics processing units (GPUs) provide specialised fixed function units called texture samplers, or texture mapping units, to perform texture mapping, usually with trilinear filtering or better multi-tap anisotropic filtering 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 implementations combine texture mapping with hidden-surface determination in tile-based deferred rendering or scanline rendering; such systems only fetch the visible texels at the expense of using greater workspace for transformed vertices. Most systems have settled on the z-buffering approach, which can still reduce the texture mapping workload with front-to-back sorting. On earlier graphics hardware, there were two competing paradigms of how to deliver a texture to the screen: Of these methods, inverse texture mapping has become standard in modern hardware. 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 of this method 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 is that the memory access pattern in the texture space 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 texture mapping, but can also be adapted for perspective correctness. 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. This was used by some hardware, such as the 3DO, the Sega Saturn 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 the § Affine texture mapping section above). The NV1 hardware also allowed a quadratic interpolation mode to provide an even better approximation of perspective correctness. UV mapping became an important technique for 3D modelling and assisted in clipping the texture correctly when the primitive went past the edge of the screen, but existing hardware did not provide effective implementations of this. These shortcomings could have been addressed with further development, but GPU design has mostly shifted toward using the inverse mapping technique. Applications Beyond 3D rendering, the availability of texture mapping hardware has inspired its use for accelerating other tasks: It is possible to use texture mapping hardware to accelerate both the reconstruction of voxel data sets from tomographic scans, and to visualize the results. Many user interfaces use texture mapping to accelerate animated transitions of screen elements, e.g. Exposé in Mac OS X. See also References Software External links
========================================
[SOURCE: https://en.wikipedia.org/wiki/Talk:Texture_mapping] | [TOKENS: 3025]
Contents Talk:Texture mapping This article contains broken links to one or more target anchors: The anchors may have been removed, renamed, or are no longer valid. Please fix them by following the link above, checking the page history of the target pages, or updating the links. Texture mapping vs parametrization The article needs a serious rewriting. There is a deep confusion between the parametrization problem and the texturing one. The code is by far unnecessary and probably make everithing less clear. I will probably remove it and rewrite some stuff in the next days. ALoopingIcon 09:15, 7 February 2006 (UTC)[reply] I think some mention should go to popular types of texturing, such as environment reflection mapping, normal/bump mapping, etc., as well as the use of transparency in texturing. Incomplete sentence At the moment, this incomplete sentence is in the article & I can't figure out what it was supposed to say: "Before Descent and Duke Nukem 3D, successfully used portal rendering and arbitrary orientation of the walls." Can anyone fix? Elf | Talk 05:02, 26 April 2006 (UTC)[reply] What??? I removed this: Between 1990 and 2000, various hybrid methods existed that mixed floating point and fractions and additionally fixed-point numbers, and mixed affine and perspective-correct texture-mapping. The mix basically uses perspective-correct texture-mapping on a large scale, but divides every polygon in 2D image-space into either quadrants (Terminal Velocity:8x8), small spans (Descent:4x1, Quake:16x1) or lines of constant z (Duke Nukem 3D, System Shock and Flight Unlimited). The constant z approach is known from Pseudo-3D. Pseudo-3D does not allow rotation of the camera, while Doom and Wacky Wheels restrict it to only one axis. Before Descent and Duke Nukem 3D, successfully used portal rendering and arbitrary orientation of the walls. 2D raytracing of a grid was added to the mix and called ray-casting. This was used in Wolfenstein 3D and Ultima Underworld. Demos often used static screen-to-texture look-up tables generated by a ray tracer to render and rotate simple symmetrical objects such as spheres and cylindrical tunnels. After 2000, perspective-correct texture mapping became widely used via floating point numbers. Perspective-correct texture mapping adds complexity, which can easily be paralleled and pipelined costing only silicon. And it adds one divide per pixel. In this respect, a graphics card has two advantages over a CPU. First, it can trade high throughput for low latency. Second, it often has a similar z and 1/z from a former calculation. Floating point numbers have the advantage that some of the bits belong to the exponent and only need to be added. The improvement from using long floating point numbers is immense, as rounding error causes several problems during rendering. For instance (this is not a collection of examples, but a complete list for the basic texture mapper), in the transformation stage, polygons do not stay convex and have to be split into trapezoids afterwards. In the edge interpolation, the polygons do not stay flat and back face culling has to be repeated every for span, otherwise the renderer may crash (with long variables, this bug may need hours to show up--or even years). Also, because of rounding in the span interpolation, the texture coordinates may overflow, so a guard band and/or tiling is used. Ray tracers are able to run real-time or high resolution. They use Barycentric coordinates, which produce holes at the vertices. But due to the high precision used in ray-tracing, it is unlikely that any ray will pass through these holes. It makes no sense for me. →AzaToth 03:23, 28 April 2006 (UTC)[reply] I support your decision. This article is still being worked, those things were just out of place. MaxDZ8 talk 06:46, 28 April 2006 (UTC)[reply] I am not. The most evident problem is this is now assumed to be just there, thus becoming Deep Magic. I am already having troubles working on shaders and level of detail (programming) so I'm sure I cannot handle this. This feature however traces back to the early ages of 3d graphics so maybe you can find something at http://accad.osu.edu/~waynec/history/PDFs/. MaxDZ8 talk 15:47, 2 May 2006 (UTC)[reply] Comments about the Code the code is not really related to what texture mapping is. Texture mapping is a rasterization problem. In the code given, texture co-ordinates are simply set. Also, most implementations of setting texture co-ords is NOT done in hardware, except if your'e using a vertex shader. The reason I mention all of this is because is has nothing to do with being perspectively correct! Perspective correct texturing involves corecting for the no-linear perpective transform. To correct for perspective, u, and v is divided by w in the rasterizer, otherwise you are dealing with affine texturing. I hope other people agree - I dont have time to edit the original, but will contribute if anyone just removes it, and adds stubs. MaxDZ8 talk 07:27, 12 June 2006 (UTC)[reply] Some rewriting July 1, 2006 I've rewritten the lead, trying to preserve the same information... though it still feels disorganized to me. I'm not even sure what to do with the "history" section... probably remove it. It appears to be trying (badly) to describe the Bresenham algorithm, but also at the same time the difference between affine and perspective-correct texture mapping (with some strange confusion between the two... why keep mentioning "fractions"?). I'm thinking the section should be removed and just replaced with more description of those two things. (I'll think about it, maybe do that edit in a few minutes.) I've also noticed that the texture filtering, bilinear interpolation, and nearest neighbor interpolation articles seem to be pretty bad as well. - Rainwarrior 20:18, 1 July 2006 (UTC)[reply] As far as I remember, my old Permedia2 on Pentium133 was already perspective correct. I hardly believe cards without this feature to be ever mass-marketed anyway so I would say it's at least 10 years this feature is commonplace. Texture projection however (division of tcCoords by .w coordinate) may be newer, I guess it was supported only by DX7 or DX6 (it was always supported by the GL) so it's a few years later. Looks all but "recently" to me. MaxDZ8 talk 09:02, 2 July 2006 (UTC)[reply] Just to add one thing about the division of tcCo-ords by 'w'. This is done in the rasterizer, to perform perspective correct texturing. This is to deal with the fact that the projection is non linear. When performing projective texture mapping, we use homogeneous texture coordinates, or coordinates in projective space. When performing non-projective texture mapping, we use real texture coordinates, or coordinates in real space. Software renderer I have not looked at your (plural) age, but you seem not to have lived in the times when home computers needed software for texture mapping. I guess everybody is happy that these times are away and even JAVA on a mobile phone uses OpenGL (you tell me if it does). The reason for this section is, that wikipedia is full of games (articles about~) out of that time. These authors have an even lower grasp of how linear and perspective correct texture mapping have been intermixed then you. I understand that the paragraph maybe too hard to understand without pics, so who cares about DooM, Quake, or descent anyway? Arnero 17:17, 14 April 2007 (UTC)[reply] Affine mapping in Doom? According to the article, Doom has to have walls perfectly vertical and floors perfectly flat because it uses affine texture mapping. The way I understand it, Doom uses a raycasting algorithm that has nothing to do with the scanline / polygon methods referred to in the article. Also, I've played Doom and seen screenshots and it doesn't seem to have any of the artifacts of affine texture mapping. So is this caption correct? 136.176.8.18 15:05, 4 September 2007 (UTC)[reply] Doom screenshot has the description "[d]oom renders vertical spans (walls) with perspective-correct texture mapping" which is not correct. Doom uses linear (affine) interpolation to map textures to vertical lines. The reason it looks perspective correct is because all walls are vertical and has no depth change when mapping the texture. — Preceding unsigned comment added by Neurosys (talk • contribs) 00:03, 26 March 2017 (UTC)[reply] Link to the same page! The article currently links to itself (1st sentence, "surface texture"). It should either be removed or a real page only about textures should be created. --78.56.57.236 (talk) 19:10, 22 February 2008 (UTC)[reply] It's probably the result of some not-well-implemented merge. Removed.MaxDZ8 talk 09:16, 23 February 2008 (UTC)[reply] Perspective correct math simplification My math skills are rusty, but doesn't the complicated equation simplify to interpolate(u)/interpolate(z)? Surely there is a less convoluted way to express this in the text than the given equation?--Henke37 (talk) 19:12, 20 July 2014 (UTC)[reply] Maybe this article should be split up into smaller pieces? texture mapping is more abstract than realtime rendering; 'Texture Map' in turn linking to S3TC, procedural texture , and bitmap images. this could also link to 3d sculpting/paint software, and mention the use of texture maps for other surface properties (light maps, specular maps), also mipmaps, swizzling, tiling, clip maps, vram. 'texture map rendering' - describing the technicalities of realtime rasterisation of texture maps; evolution from 'affine texture mappers' (e.g. PS1) to 'perspective correction', and describe the various approximation approaches possible. The main article should describes the overall concept, and links to 3d modelling packages & concepts, and the above. methods of UV editing, cylindrical mapping unwraps etc. However as I suggest this I'm reminded of how I run into 'notability' issues. I personally prefer the idea of smaller articles because they link concepts more accurately, aiding discovery (and future use as an AI resource) Fmadd (talk) 12:11, 4 June 2016 (UTC)[reply] split the article? Perhaps the article would be better split into 3 ? (I've tried to re-arrange into sections that would 'map' onto them) As I make this suggestion, I'm reminded how I often run into 'notability guidelines'. However smaller articles are IMO more manageable (the wording and ordering of a large article can become incoherent) and they flow better through more precise links - improving discoverability, and increasing wikipedias' value as an AI resource. Fmadd (talk) 12:26, 4 June 2016 (UTC)[reply] ok i found a better solution? adding a computer graphics glossary, which might allow streamlining this article by simple links to definitions instead of needing so many sections here Fmadd (talk) 13:11, 5 June 2016 (UTC)[reply] Information related to hardware implementations of texture mapping and rasterization Posting here at Fmadd's suggestion. Prefacing this with an "I'm new, please forgive my mistakes and provide some guidance" in case I do this wrong. the following patent: https://www.google.com/patents/US6002738 describes a method and apparatus to perform both tomographic reconstructions and volume rendering using texture mapping within the same device. Essentially, the invention interprets tomographic data from something like a CT scan and processes and displays the resulting information using texture mapping techniques and hardware. Quote "The mathematical and algorithmic similarity of volume rendering and backprojection, when reformulated in terms of texture mapping and accumulation, is significant. It means that a single high performance computer graphics and imaging computer can be used to both render and reconstruct volumes at rates of 100 to 1000 times faster than CPU based techniques. Additionally, a high performance computer graphics and imaging computer is an order of magnitude less expensive than a conventional CT system." I also have access to one of the authors of the following document:http://dl.acm.org/citation.cfm?id=134071 which describes shadows and lighting effects using texture mapping. I believe I can also obtain physical copies of the SIGGRAPH proceedings from 1991 through 1999 at least, which I can use to add additional citations to multiple pages on the computer graphics pages. Ignus3 (talk) 19:31, 13 June 2016 (UTC)[reply] Baking The subsection does not define what exactly is baking. Maybe somebody can help with that. — Preceding unsigned comment added by 148.225.71.160 (talk) 19:41, 29 March 2017 (UTC)[reply] Doom caption misleading FTFA: Doom engine renders vertical and horizontal spans with affine texture mapping, and is therefore unable to draw ramped floors or slanted walls. Unless you know precisely how the engine works, this is very misleading. The texture mapping in Doom is only affine in the directions orthogonal to the viewing direction, which is also the only direction where it makes no difference. Also, while this explains why the use of affine mapping in this direction doesn't affect the result, it doesn't explain why it cannot render slanted floors and walls, this is due to other engine limitations. Tomb Raider for example could render slanted floors, although both its floors (even flat ones) and walls were affected by the display problem caused by affine texture mapping. — Preceding unsigned comment added by 77.61.180.106 (talk) 00:13, 12 December 2021 (UTC)[reply]
========================================
[SOURCE: https://en.wikipedia.org/wiki/Texture_mapping#cite_note-3] | [TOKENS: 4408]
Contents Texture mapping 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 apart so that it can be unfolded into a 2D coordinate space (UV space). Semantic Texture mapping can multiply refer to (1) the task of unwrapping a 3D model (converting the surface of a 3D model into a 2D texture map), (2) applying a 2D texture map onto the surface of a 3D model, and (3) the 3D software algorithm that performs both tasks. A texture map refers to a 2D image ("texture") that adds visual detail to a 3D model. The image can be stored as a raster graphic. A texture that stores a specific property—such as bumpiness, reflectivity, or transparency—is also referred to as a color map or roughness map. The coordinate space that converts from a 3D model's 3D space into a 2D space for sampling from the texture map is variously called UV space, UV coordinates, or texture space. Algorithm The following is a simplified explanation of how an algorithm could work to render an image: History The original technique was pioneered by Edwin Catmull in 1974 as part of his doctoral thesis. Texture mapping originally referred to diffuse mapping, a method that simply mapped pixels from a texture to a 3D surface ("wrapping" the image around the object). In recent decades, the advent of multi-pass rendering, multitexturing, mipmaps, and more complex mappings such as height mapping, bump mapping, normal mapping, displacement mapping, reflection mapping, specular mapping, occlusion mapping, and many other variations on the technique (controlled by a materials system) have made it possible to simulate near-photorealism in real time by vastly reducing the number of polygons and lighting calculations needed to construct a realistic and functional 3D scene. Texture maps A texture map is an image applied ("mapped") to the surface of a shape or polygon. This may be a bitmap image or a procedural texture. They may be stored in common image file formats, referenced by 3D model formats or material definitions, and assembled into resource bundles. 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. 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. Texture maps usually contain RGB color data (either stored as direct color, compressed formats, or indexed color), and sometimes an additional channel for alpha blending (RGBA) especially for billboards and decal overlay textures. It is possible to use the alpha channel (which may be convenient to store in formats parsed by hardware) for other uses such as specularity. Multiple texture maps (or channels) may be combined for control over specularity, normals, displacement, or subsurface scattering, 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 textures with multiple faces for environment mapping. Texture maps may be acquired by scanning or digital photography, designed in image manipulation software such as GIMP or Photoshop, or painted onto 3D surfaces directly in a 3D paint tool such as Mudbox or ZBrush. 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. This might be accomplished via planar projection or, alternatively, cylindrical or spherical 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" mapping from every piece of a surface (which is important for render mapping and light mapping, also known as baking). Texture mapping maps the model surface (or screen space 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 may be performed approximately by texture-space operations. Multitexturing is the use of more than one texture at a time on a polygon. For instance, a light map 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 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, for greater fidelity. Another multitexture technique is bump mapping, 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 video games, as graphics hardware has become powerful enough to accommodate it in real-time. The way that samples (e.g. when viewed as pixels on the screen) are calculated from the texels (texture pixels) is governed by texture filtering. The cheapest method is to use the nearest-neighbour interpolation, but bilinear interpolation or trilinear interpolation between mipmaps are two commonly used alternatives which reduce aliasing or jaggies. In the event of a texture coordinate being outside the texture, it is either clamped or wrapped. Anisotropic filtering better eliminates directional artefacts when viewing textures from oblique viewing angles. Texture streaming is a means of using data streams 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. As an optimization, it is possible to render detail from a complex, high-resolution model or expensive process (such as global illumination) into a surface texture (possibly on a low-resolution model). This technique is called baking (or render mapping) and 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) have used this technique. The original Quake software engine used on-the-fly baking to combine light maps and colour maps in a process called 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 linearly interpolates texture coordinates across a surface, making it the fastest form of texture mapping. Some software and hardware (such as the original PlayStation) project 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 or by an incremental error algorithm akin to Bresenham's line algorithm. In contrast to perpendicular polygons, this leads to noticeable distortion with perspective transformations (as shown in the figure: the checker box texture appears bent), especially as primitives near the camera. This distortion can be reduced by subdividing polygons into smaller polygons. Using quad primitives for rectangular objects can look less incorrect than if those rectangles were split into triangles. However, since interpolating four 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, offered efficient quad primitives. With perspective correction, triangles become equivalent to quad primitives 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. Affine linear interpolation across that horizontal span will look correct because every pixel along that line is the same distance from the viewer. Perspective correct texturing accounts for the vertices' positions in 3D space rather than simply interpolating coordinates in 2D screen space. While achieving the correct visual effect, perspective correct texturing is more expensive to calculate. To perform perspective correction of the texture coordinates u {\displaystyle u} and v {\displaystyle v} , with z {\displaystyle z} being the depth component from the viewer's point of view, it is possible to take advantage of the fact that the values 1 z {\displaystyle {\frac {1}{z}}} , u z {\displaystyle {\frac {u}{z}}} , and v z {\displaystyle {\frac {v}{z}}} are linear in screen space across the surface being textured. In contrast, the original z {\displaystyle z} , u {\displaystyle u} , and v {\displaystyle v} , before the division, are not linear across the surface in screen space. It is therefore possible to linearly interpolate these reciprocals across the surface, computing corrected values at each pixel, to produce a perspective correct texture mapping. To do this, the reciprocals at each vertex of the geometry (three points for a triangle) are calculated. Vertex n {\displaystyle n} has reciprocals u n z n {\displaystyle {\frac {u_{n}}{z_{n}}}} , v n z n {\displaystyle {\frac {v_{n}}{z_{n}}}} , and 1 z n {\displaystyle {\frac {1}{z_{n}}}} . Then, linear interpolation can be done on these reciprocals between the n {\displaystyle 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 {\displaystyle u_{i},v_{i}} and 1 z i {\displaystyle {\frac {1}{z_{i}}}} (reciprocal z i {\displaystyle z_{i}} ). However, as our division by z {\displaystyle z} altered their coordinate system, this u i , v i {\displaystyle u_{i},v_{i}} cannot be used as texture coordinates. To correct back to the u , v {\displaystyle u,v} space, the corrected z {\displaystyle z} is calculated by taking the reciprocal once again: z c o r r e c t = 1 1 z i {\displaystyle z_{correct}={\frac {1}{\frac {1}{z_{i}}}}} . This is then used to correct the u i , v i {\displaystyle u_{i},v_{i}} coordinates: u c o r r e c t = u i ⋅ z i {\displaystyle u_{correct}=u_{i}\cdot z_{i}} and v c o r r e c t = v i ⋅ z i {\displaystyle v_{correct}=v_{i}\cdot z_{i}} . This correction makes it so that the difference from pixel to pixel between texture coordinates is smaller in parts of the polygon that are closer to the viewer (stretching the texture wider) and is larger in parts that are farther away (compressing the texture). Affine texture mapping directly interpolates a texture coordinate u α {\displaystyle u_{\alpha }} between two endpoints u 0 {\displaystyle u_{0}} and u 1 {\displaystyle u_{1}} : u α = ( 1 − α ) u 0 + α u 1 {\displaystyle u_{\alpha }=(1-\alpha )u_{0}+\alpha u_{1}} where 0 ≤ α ≤ 1 {\displaystyle 0\leq \alpha \leq 1} . Perspective correct mapping interpolates after dividing by depth z {\displaystyle z} , then uses its interpolated reciprocal to recover the correct coordinate: u α = ( 1 − α ) u 0 z 0 + α u 1 z 1 ( 1 − α ) 1 z 0 + α 1 z 1 {\displaystyle u_{\alpha }={\frac {(1-\alpha ){\frac {u_{0}}{z_{0}}}+\alpha {\frac {u_{1}}{z_{1}}}}{(1-\alpha ){\frac {1}{z_{0}}}+\alpha {\frac {1}{z_{1}}}}}} 3D graphics hardware typically supports perspective correct texturing. Various techniques have evolved for rendering texture mapped geometry into images with different quality and precision trade-offs, which can be applied to both software and hardware. Classic software texture mappers generally only performed simple texture mapping with one lighting effect at most (typically applied through a lookup table), and the perspective correctness was about 16 times more expensive.[compared to?] The Doom engine restricted the world to vertical walls and horizontal floors and 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 and 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 which allowed the appearance of greater freedom while using the same rendering technique. Some engines were able to render texture mapped heightmaps (e.g. Nova Logic'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. Every triangle can be further subdivided into groups of about 16 pixels in order to achieve two goals: keeping the arithmetic mill busy at all times and producing faster arithmetic results.[vague] 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 made extensive use of this because it only supported affine mapping in hardware and had a relatively high triangle throughput compared to its peers. Software renderers generally prefer 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), thus lessening the overhead further. Another reason is that affine texture mapping does not fit into the low number of CPU registers of the x86 CPU; the 68000 and RISC processors are much more suited for that approach. 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. As the polygons are rendered independently, 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.[original research?] One other technique is to approximate the perspective with a faster calculation, such as a polynomial. A second uses the 1 z i {\textstyle {\frac {1}{z_{i}}}} value of the last two drawn pixels to linearly extrapolate the next value. For the latter, the division is then done starting from those values so that all that has to be divided is a small remainder. However, the amount of bookkeeping needed makes this technique too slow on most systems.[citation needed] A third technique, used by the Build Engine (used, most notably, in Duke Nukem 3D), builds on the constant distance trick used by the Doom engine by finding and rendering along the line of constant distance for arbitrary polygons. 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) and broadcast digital video effects machines such as the Ampex ADO. Texture mapping hardware later appeared in arcade cabinets, consumer video game consoles, and PC video cards in the mid-1990s. In flight simulations, texture mapping provided important motion and altitude cues necessary for pilot training not available on untextured surfaces. Additionally, texture mapping was implemented so that real-time processing of prefiltered texture patterns stored in memory could be accessed by the video processor in real-time. Modern graphics processing units (GPUs) provide specialised fixed function units called texture samplers, or texture mapping units, to perform texture mapping, usually with trilinear filtering or better multi-tap anisotropic filtering 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 implementations combine texture mapping with hidden-surface determination in tile-based deferred rendering or scanline rendering; such systems only fetch the visible texels at the expense of using greater workspace for transformed vertices. Most systems have settled on the z-buffering approach, which can still reduce the texture mapping workload with front-to-back sorting. On earlier graphics hardware, there were two competing paradigms of how to deliver a texture to the screen: Of these methods, inverse texture mapping has become standard in modern hardware. 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 of this method 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 is that the memory access pattern in the texture space 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 texture mapping, but can also be adapted for perspective correctness. 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. This was used by some hardware, such as the 3DO, the Sega Saturn 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 the § Affine texture mapping section above). The NV1 hardware also allowed a quadratic interpolation mode to provide an even better approximation of perspective correctness. UV mapping became an important technique for 3D modelling and assisted in clipping the texture correctly when the primitive went past the edge of the screen, but existing hardware did not provide effective implementations of this. These shortcomings could have been addressed with further development, but GPU design has mostly shifted toward using the inverse mapping technique. Applications Beyond 3D rendering, the availability of texture mapping hardware has inspired its use for accelerating other tasks: It is possible to use texture mapping hardware to accelerate both the reconstruction of voxel data sets from tomographic scans, and to visualize the results. Many user interfaces use texture mapping to accelerate animated transitions of screen elements, e.g. Exposé in Mac OS X. See also References Software External links
========================================
[SOURCE: https://en.wikipedia.org/wiki/Bump_mapping] | [TOKENS: 590]
Contents 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 calculations. The result is an apparently bumpy surface rather than a smooth surface, although the surface of the underlying object is not changed. Bump mapping was introduced by James Blinn in 1978. Bump mapping is the most common variation of bump mapping used. Principles Bump mapping is a technique in computer graphics to make a rendered surface look more realistic by simulating small displacements of the surface. However, unlike displacement mapping, the surface geometry is not modified. Instead only the surface normal is modified as if the surface had been displaced. The modified surface normal is then used for lighting calculations (using, for example, the Phong reflection model) giving the appearance of detail instead of a smooth surface. Bump mapping is much faster and consumes fewer resources for the same level of detail compared to displacement mapping because the geometry remains unchanged. There are also extensions which modify other surface features in addition to increasing the sense of depth. Parallax mapping and horizon mapping are two such extensions. The primary limitation with bump mapping is that it perturbs only the surface normals without changing the underlying surface itself. Silhouettes and shadows therefore remain unaffected, which is especially noticeable for larger simulated displacements. This limitation can be overcome by techniques including displacement mapping where bumps are applied to the surface or using an isosurface. There are two primary methods to perform bump mapping. The first uses a height map for simulating the surface displacement yielding the modified normal. This is the method invented by Blinn and is usually what is referred to as bump mapping unless specified. The steps of this method are summarized as follows. Before a lighting calculation is performed for each visible point (or pixel) on the object's surface: The result is a surface that appears to have real depth. The algorithm also ensures that the surface appearance changes as lights in the scene are moved around. The other method is to specify a normal map which contains the modified normal for each point on the surface directly. Since the normal is specified directly instead of derived from a height map this method usually leads to more predictable results. This makes it easier for artists to work with, making it the most common method of bump mapping today. Realtime bump mapping techniques Realtime 3D graphics programmers often use variations of the technique in order to simulate bump mapping at a lower computational cost. One typical way was to use a fixed geometry, which allows one to use the heightmap surface normal almost directly. Combined with a precomputed lookup table for the lighting calculations, the method could be implemented with a very simple and fast loop, allowing for a full-screen effect. This method was a common visual effect when bump mapping was first introduced. See also References External links
========================================
[SOURCE: https://en.wikipedia.org/wiki/Mipmap] | [TOKENS: 1352]
Contents 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 smaller than the previous. Their use is known as mipmapping. They are intended to increase rendering speed and reduce aliasing artifacts. A high-resolution mipmap image is used for high-density samples, such as for objects close to the camera; lower-resolution images are used as the object appears farther away. This is a more efficient way of downscaling a texture than sampling all texels in the original texture that would contribute to a screen pixel; it is faster to take a constant number of samples from the appropriately downfiltered textures. Since mipmaps, by definition, are pre-allocated, additional storage space is required to take advantage of them. They are also related to wavelet compression. Mipmaps are widely used in 3D computer games, flight simulators, other 3D imaging systems for texture filtering, and 2D and 3D GIS software. Mipmap textures are used in 3D scenes to decrease the time required to render a scene. They also improve image quality by reducing aliasing and Moiré patterns that occur at large viewing distances, at the cost of 33% more memory per texture. History Mipmapping was invented by Lance Williams in 1983 and is described in his paper Pyramidal parametrics. From the abstract: "This paper advances a 'pyramidal parametric' prefiltering and sampling geometry which minimizes aliasing effects and assures continuity within and between target images." The referenced pyramid can be imagined as the set of mipmaps stacked in front of each other. The first patent issued on Mipmap and texture generation was in 1983 by Johnson Yan, Nicholas Szabo, and Lish-Yann Chen of Link Flight Simulation (Singer). Using their approach, texture could be generated and superimposed on surfaces (curvilinear and planar) of any orientation and could be done in real-time. Texture patterns could be modeled suggestive of the real world material they were intended to represent in a continuous way and free of aliasing, ultimately providing level of detail and gradual (imperceptible) detail level transitions. Texture generating became repeatable and coherent from frame to frame and remained in correct perspective and appropriate occultation. Because the application of real time texturing was applied to early three dimensional flight simulator CGI systems, and texture being a prerequisite for realistic graphics, this patent became widely cited and many of these techniques were later applied in graphics computing and gaming as applications expanded over the years. The origin of the term mipmap is an initialism of the Latin phrase multum in parvo ("much in little"), and map, modeled on bitmap. The term pyramids is still commonly used in a GIS context. In GIS software, pyramids are primarily used for speeding up rendering times. Mechanism Each bitmap image of the mipmap set is a downsized duplicate of the main texture, but at a certain reduced level of detail. Although the main texture would still be used when the view is sufficient to render it in full detail, the renderer will switch to a suitable mipmap image (or in fact, interpolate between the two nearest, if trilinear filtering is activated) when the texture is viewed from a distance or at a small size. Rendering speed increases since the number of texture pixels (texels) being processed per display pixel can be much lower for similar results with the simpler mipmap textures. If using a limited number of texture samples per display pixel (as is the case with bilinear filtering) then artifacts are reduced since the mipmap images are effectively already anti-aliased. Scaling down and up is made more efficient with mipmaps as well. If the texture has a basic size of 256 by 256 pixels, then the associated mipmap set may contain a series of 8 images, each one-fourth the total area of the previous one: 128×128 pixels, 64×64, 32×32, 16×16, 8×8, 4×4, 2×2, 1×1 (a single pixel). If, for example, a scene is rendering this texture in a space of 40×40 pixels, then either a scaled-up version of the 32×32 (without trilinear interpolation) or an interpolation of the 64×64 and the 32×32 mipmaps (with trilinear interpolation) would be used. The simplest way to generate these textures is by successive averaging; however, more sophisticated algorithms (perhaps based on signal processing and Fourier transforms) can also be used. The increase in storage space required for all of these mipmaps is a third of the original texture, because the sum of the areas 1/4 + 1/16 + 1/64 + 1/256 + ⋯ converges to 1/3. In the case of an RGB image with three channels stored as separate planes, the total mipmap can be visualized as fitting neatly into a square area twice as large as the dimensions of the original image on each side (twice as large on each side is four times the original area - one plane of the original size for each of red, green and blue makes three times the original area, and then since the smaller textures take 1/3 of the original, 1/3 of three is one, so they will take the same total space as just one of the original red, green, or blue planes). This is the inspiration for the tag multum in parvo. Uses Mipmaps are used for: Anisotropic filtering When a texture is viewed at a steep angle, the filtering should not be uniform in each direction (it should be anisotropic rather than isotropic), and a compromise resolution is required. If a higher resolution is used, the cache coherence goes down, and the aliasing is increased in one direction, but the image tends to be clearer. If a lower resolution is used, the cache coherence is improved, but the image is overly blurry. This would be a tradeoff of MIP level of detail (LOD) for aliasing vs blurriness. However anisotropic filtering attempts to resolve this trade-off by sampling a non isotropic texture footprint for each pixel rather than merely adjusting the MIP LOD. This non isotropic texture sampling requires either a more sophisticated storage scheme or a summation of more texture fetches at higher frequencies. See also References
========================================
[SOURCE: https://en.wikipedia.org/wiki/Edwin_Catmull] | [TOKENS: 1680]
Contents Edwin Catmull Edwin Earl Catmull (born March 31, 1945) is an American computer scientist and animator who is the co-founder of Pixar and was the president of Walt Disney Animation Studios. He has been recognized for his contributions to 3-D computer graphics, including the 2019 ACM Turing Award. Early life Edwin Catmull was born on March 31, 1945, in Parkersburg, West Virginia. His family later moved to Salt Lake City, Utah, where his father first served as principal of Granite High School and then of Taylorsville High School. Early in his life, Catmull found inspiration in Disney movies, including Peter Pan and Pinocchio, and wanted to be an animator; however, after finishing high school, he had no idea how to get there as there were no animation schools around that time. Because he also liked math and physics, he chose a scientific career instead. He also made animation using flip-books. Catmull graduated in 1969, with a B.S. in physics and computer science from the University of Utah. Initially interested in designing programming languages, Catmull encountered Ivan Sutherland, who had designed the computer drawing program Sketchpad, and changed[vague] his interest to digital imaging. As a student of Sutherland, he was part of the university's DARPA program, sharing classes with James H. Clark, John Warnock and Alan Kay. From that point, his main goal was to make feature films using advanced computer graphics, an unheard-of concept at the time. During his time at the university, he made two new fundamental computer-graphics discoveries: texture mapping and bicubic patches; and invented algorithms for spatial anti-aliasing and refining subdivision surfaces. Catmull says the idea for subdivision surfaces came from mathematical structures in his mind when he applied B-splines to non-four sided objects. He also independently discovered Z-buffering, which had been described eight months before by Wolfgang Straßer in his PhD thesis. In 1972, Catmull made his earliest contribution to the film industry: a one-minute animated version of his left hand, titled A Computer Animated Hand, created with Fred Parke at the University of Utah. This short sequence was eventually picked up by a Hollywood producer and incorporated in the 1976 film Futureworld, which was the first film to use 3D computer graphics and a science-fiction sequel to the 1973 film Westworld, itself being the first to use a pixelated image generated by a computer. A Computer Animated Hand was selected for preservation in the National Film Registry of the Library of Congress in December 2011. Career In 1974, Catmull earned his doctorate in computer science, and was hired by a company called Applicon. By November of that year, he had been contacted by Alexander Schure, the founder of the New York Institute of Technology, who offered him the position as the director of the institute's new Computer Graphics Lab. In that position, in 1977, he invented Tween, software for 2D animation that automatically produced frames of motion in between two frames. However, Catmull's team lacked the ability to tell a story effectively via film, harming the effort to produce a motion picture via a computer. Catmull and his partner, Alvy Ray Smith, attempted to reach out to studios to alleviate this issue, but were generally unsuccessful until they attracted the attention of George Lucas at Lucasfilm. Lucas approached Catmull in 1979 and asked him to lead a group to bring computer graphics, video editing, and digital sound into the entertainment field. Lucas had already made a deal with a computer company called Triple-I, and asked them to create a digital model of an X-wing fighter from Star Wars, which they did. In 1979, Catmull became the Vice President at Lucasfilm, set up to launch a "computer division" inside the company. By 1980 he had established three projects and recruited experts to lead them: the graphics group led by Alvy Ray Smith; the audio project led by Andy Moorer; the nonlinear editing project, led by Ralph Guggenheim. In 1986, Steve Jobs bought Lucasfilm's digital division and founded Pixar, where Catmull works. Pixar would be acquired by Disney in 2006. In June 2007, Catmull and long-time Pixar digital animator and director John Lasseter were given control of Disneytoon Studios, a division of Walt Disney Animation housed in a separate facility in Glendale. As president and chief creative officer, respectively, they have supervised three separate studios for Disney, each with its own production pipeline: Pixar, Disney Animation, and Disneytoon. While Disney Animation and Disneytoon are located in the Los Angeles area, Pixar is located over 350 miles (563 kilometers) northwest in the San Francisco Bay Area, where Catmull and Lasseter both live. Accordingly, they appointed a general manager for each studio to handle day-to-day affairs on their behalf, then began regularly commuting each week to both Pixar and Disney Animation and spending at least two days per week (usually Tuesdays and Wednesdays) at Disney Animation. While at Pixar, Catmull was implicated in the High-Tech Employee Antitrust scandal, in which Bay Area technology companies allegedly agreed, among other things, not to cold-call recruit from one another. Catmull defended his actions in a deposition, saying: "While I have responsibility for the payroll, I have responsibility for the long term also." Disney and its subsidiaries, including Pixar, ultimately paid $100 million in settlement compensation. In November 2014, the general managers of Disney Animation and Pixar were both promoted to president, but both continued to report to Catmull, who retained the title of president of Walt Disney and Pixar. On October 23, 2018, Catmull announced his plans to retire from Pixar and Disney Animation, staying on as an adviser through July 2019. In March 2022, Thatgamecompany announced the addition of Catmull as principal adviser on creative culture and strategic growth. Personal life As of 2006, Catmull lives in Marin County, California, with his wife, Susan Anderson, and their three children. Catmull has an inability to form mental imagery within his head, a condition known as aphantasia. Awards and honors In 1993, Catmull received his first Academy Scientific and Technical Award from the Academy of Motion Picture Arts and Sciences "for the development of PhotoRealistic RenderMan software which produces images used in motion pictures from 3D computer descriptions of shape and appearance". He shared this award with Thomas K. Porter. In 1995, he was inducted as a Fellow of the Association for Computing Machinery. Again in 1996, he received an Academy Scientific and Technical Award "for pioneering inventions in Digital Image Compositing". In 2000, Catmull was elected a member of the National Academy of Engineering for leadership in the creation of digital imagery, leading to the introduction of fully synthetic visual effects and motion pictures. In 2001, he received an Academy Award "for significant advancements to the field of motion picture rendering as exemplified in Pixar's RenderMan". In 2006, he was awarded the IEEE John von Neumann All-Medal Crown Of Trophies for pioneering contributions to the field of computer graphics in modeling, animation, and rendering. At the 81st Academy Awards (2008, presented in February 2009), Catmull was awarded the Gordon E. Sawyer Award, which honors "an individual in the motion picture industry whose technological contributions have brought credit to the industry". In 2013, the Computer History Museum named him a Museum Fellow "for his pioneering work in computer graphics, animation and filmmaking". His book Creativity, Inc. was shortlisted for the Financial Times and Goldman Sachs Business Book of the Year Award (2014), and was a selection for Mark Zuckerberg book club in March 2015. Catmull shared the 2019 Turing Award with Pat Hanrahan for their pioneering work on computer-generated imagery. Filmography See also Publications References External links
========================================
[SOURCE: https://en.wikipedia.org/w/index.php?title=Texture_mapping&action=info] | [TOKENS: 43]
Contents Information for "Texture mapping" Basic information Page protection Edit history Page properties This page is a member of 12 hidden categories (help): Pages transcluded onto the current version of this page (help): External tools
========================================
[SOURCE: https://en.wikipedia.org/wiki/Displacement_mapping] | [TOKENS: 962]
Contents 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 displaced, often along the local surface normal, according to the value the texture function evaluates to at each point on the surface. It gives surfaces a sense of depth and detail, permitting in particular self-occlusion, self-shadowing and silhouettes; on the other hand, it is the most costly of this class of techniques owing to the large amount of additional geometry. For years, displacement mapping was a peculiarity of high-end rendering systems like PhotoRealistic RenderMan, while realtime APIs, like OpenGL and DirectX, were only starting to use this feature. One of the reasons for this is that the original implementation of displacement mapping required an adaptive tessellation of the surface in order to obtain enough micropolygons whose size matched the size of a pixel on the screen.[citation needed] Meaning of the term in different contexts Displacement mapping includes the term mapping which refers to a texture map being used to modulate the displacement strength. The displacement direction is usually the local surface normal. Today, many renderers allow programmable shading which can create high quality (multidimensional) procedural textures and patterns at arbitrarily high frequencies. The use of the term mapping becomes arguable then, as no texture map is involved anymore. Therefore, the broader term displacement is often used today to refer to a super concept that also includes displacement based on a texture map. Renderers using the REYES algorithm, or similar approaches based on micropolygons, have allowed displacement mapping at arbitrary high frequencies since they became available almost 20 years ago. The first commercially available renderer to implement a micropolygon displacement mapping approach through REYES was Pixar's PhotoRealistic RenderMan. Micropolygon renderers commonly tessellate geometry themselves at a granularity suitable for the image being rendered. That is: the modeling application delivers high-level primitives to the renderer. Examples include true NURBS- or subdivision surfaces. The renderer then tessellates this geometry into micropolygons at render time using view-based constraints derived from the image being rendered. Other renderers that require the modeling application to deliver objects pre-tessellated into arbitrary polygons or even triangles have defined the term displacement mapping as moving the vertices of these polygons. Often the displacement direction is also limited to the surface normal at the vertex. While conceptually similar, those polygons are usually a lot larger than micropolygons. The quality achieved from this approach is thus limited by the geometry's tessellation density a long time before the renderer gets access to it. This difference between displacement mapping in micropolygon renderers vs. displacement mapping in a non-tessellating (macro)polygon renderers can often lead to confusion in conversations between people whose exposure to each technology or implementation is limited. Even more so, as in recent years, many non-micropolygon renderers have added the ability to do displacement mapping of a quality similar to that which a micropolygon renderer is able to deliver naturally. To distinguish between the crude pre-tessellation-based displacement these renderers did before, the term sub-pixel displacement was introduced to describe this feature.[citation needed] Sub-pixel displacement commonly refers to finer re-tessellation of geometry that was already tessellated into polygons. This re-tessellation results in micropolygons or often microtriangles. The vertices of these then get moved along their normals to achieve the displacement mapping. True micropolygon renderers have always been able to do what sub-pixel-displacement achieved only recently, but at a higher quality and in arbitrary displacement directions. Recent developments seem to indicate that some of the renderers that use sub-pixel displacement move towards supporting higher level geometry too. As the vendors of these renderers are likely to keep using the term sub-pixel displacement, this will probably lead to more obfuscation of what displacement mapping really stands for, in 3D computer graphics. In reference to Microsoft's proprietary High Level Shader Language, displacement mapping can be interpreted as a kind of "vertex-texture mapping" where the values of the texture map do not alter pixel colors (as is much more common), but instead change the position of vertices. Unlike bump, normal and parallax mapping, all of which can be said to "fake" the behavior of displacement mapping, in this way a genuinely rough surface can be produced from a texture. It has to be used in conjunction with adaptive tessellation techniques (that increases the number of rendered polygons according to current viewing settings) to produce highly detailed meshes.[citation needed] See also Further reading References
========================================
[SOURCE: https://en.wikipedia.org/wiki/Normal_mapping] | [TOKENS: 2325]
Contents 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 polygons. A common use of this technique is to greatly enhance the appearance and details of a low polygon model by generating a normal map from a high polygon model or height map. Normal maps are commonly stored as regular RGB images where the RGB components correspond to the X, Y, and Z coordinates, respectively, of the surface normal. History In 1978 Jim Blinn described how the normals of a surface could be perturbed to make geometrically flat faces have a detailed appearance. The idea of taking geometric details from a high polygon model was introduced in "Fitting Smooth Surfaces to Dense Polygon Meshes" by Krishnamurthy and Levoy, Proc. SIGGRAPH 1996, where this approach was used for creating displacement maps over nurbs. In 1998, two papers were presented with key ideas for transferring details with normal maps from high to low polygon meshes: "Appearance Preserving Simplification", by Cohen et al. SIGGRAPH 1998, and "A general method for preserving attribute values on simplified meshes" by Cignoni et al. IEEE Visualization '98. The former introduced the idea of storing surface normals directly in a texture, rather than displacements, though it required the low-detail model to be generated by a particular constrained simplification algorithm. The latter presented a simpler approach that decouples the high and low polygonal mesh and allows the recreation of any attributes of the high-detail model (color, texture coordinates, displacements, etc.) in a way that is not dependent on how the low-detail model was created. The combination of storing normals in a texture, with the more general creation process is still used by most currently available tools. Spaces The orientation of coordinate axes differs depending on the space in which the normal map was encoded. A straightforward implementation encodes normals in object space so that the red, green, and blue components correspond directly with the X, Y, and Z coordinates. In object space, the coordinate system is constant. However, object-space normal maps cannot be easily reused on multiple models, as the orientation of the surfaces differs. Since color texture maps can be reused freely, and normal maps tend to correspond with a particular texture map, it is desirable for artists that normal maps have the same property. Normal map reuse is made possible by encoding maps in tangent space. The tangent space is a vector space, which is tangent to the model's surface. The coordinate system varies smoothly (based on the derivatives of position with respect to texture coordinates) across the surface. Tangent space normal maps can be identified by their dominant purple color, corresponding to a vector facing directly out from the surface. See Calculation. Calculating tangent spaces Surface normals are used in computer graphics primarily for the purposes of lighting, through mimicking a phenomenon called specular reflection. Since the visible image of an object is the light bouncing off of its surface, the light information obtained from each point of the surface can instead be computed on its tangent space at that point. For each tangent space of a surface in 3-dimensional space, there are two vectors which are perpendicular to every vector of the tangent space. These vectors are called normal vectors, and choosing between these two vectors provides a description on how the surface is oriented at that point, as the light information depends on the angle of incidence between the ray r {\displaystyle \mathbf {r} } and the normal vector n {\displaystyle \mathbf {n} } , and the light will only be visible if r ⋅ n > 0 {\displaystyle \mathbf {r} \cdot \mathbf {n} >0} . In such a case, the reflection s {\displaystyle \mathbf {s} } of the ray with direction r {\displaystyle \mathbf {r} } along the normal vector n {\displaystyle \mathbf {n} } is given by where the projection of the ray onto the normal is ( r ⋅ n ) n {\displaystyle (\mathbf {r} \cdot \mathbf {n} )\mathbf {n} } . Intuitively, this just means that you can only see the outward face of an object if you're looking from the outside, and only see the inward face if you're looking from the inside. Note that the light information is local, and so the surface does not necessarily need to be orientable as a whole. This is why even though spaces such as the Möbius strip and the Klein bottle are non-orientable, it is still possible to visualize them. Normals can be specified with a variety of coordinate systems. In computer graphics, it is useful to compute normals relative to the tangent plane of the surface. This is useful because surfaces in applications undergo a variety of transforms, such as in the process of being rendered, or in skeletal animations, and so it is important for the normal vector information to be preserved under these transformations. Examples of such transforms include transformation, rotation, shearing and scaling, perspective projection, or the skeletal animations on a finely detailed character. For the purposes of computer graphics, the most common representation of a surface is a triangulation, and as a result, the tangent plane at a point can be obtained through interpolating between the planes that contain the triangles that each intersect that point. Similarly, for parametric surfaces with tangent spaces, the parametrizations will yield partial derivatives, and these derivatives can be used as a basis of the tangent spaces at every point. In order to find the perturbation in the normal the tangent space must be correctly calculated. Most often the normal is perturbed in a fragment shader after applying the model and view matrices[citation needed]. Typically the geometry provides a normal and tangent. The tangent is part of the tangent plane and can be transformed simply with the linear part of the matrix (the upper 3x3). However, the normal needs to be transformed by the inverse transpose. Most applications will want bitangent to match the transformed geometry (and associated UVs). So instead of enforcing the bitangent to be perpendicular to the tangent, it is generally preferable to transform the bitangent just like the tangent. Let t {\displaystyle \mathbf {t} } be tangent, b {\displaystyle \mathbf {b} } be bitangent, n {\displaystyle \mathbf {n} } be normal, M {\displaystyle \mathbf {M} } be the linear part of the 3x3 model matrix, and V {\displaystyle \mathbf {V} } be the linear part of the 3x3 view matrix. Calculation To calculate the Lambertian (diffuse) lighting of a surface, the unit vector from the shading point to the light source is dotted with the unit vector normal to that surface, and the result is the intensity of the light on that surface. Imagine a polygonal model of a sphere - you can only approximate the shape of the surface. By using a 3-channel bitmap textured across the model, more detailed normal vector information can be encoded. Each channel in the bitmap corresponds to a spatial dimension (X, Y and Z). These spatial dimensions are relative to a constant coordinate system for object-space normal maps, or to a smoothly varying coordinate system (based on the derivatives of position with respect to texture coordinates) in the case of tangent-space normal maps. This adds much more detail to the surface of a model, especially in conjunction with advanced lighting techniques. Unit Normal vectors corresponding to the u,v texture coordinate are mapped onto normal maps. Only vectors pointing towards the viewer (z: 0 to -1 for Left Handed Orientation) are present, since the vectors on geometries pointing away from the viewer are never shown. The mapping is as follows: Since a normal will be used in the dot product calculation for the diffuse lighting computation, we can see that the {0, 0, –1} would be remapped to the {128, 128, 255} values, giving that kind of sky blue color seen in normal maps (blue (z) coordinate is perspective (deepness) coordinate and RG-xy flat coordinates on screen). {0.3, 0.4, –0.866} would be remapped to the ({0.3, 0.4, –0.866}/2+{0.5, 0.5, 0.5})*255={0.15+0.5, 0.2+0.5, -0.433+0.5}*255={0.65, 0.7, 0.067}*255={166, 179, 17} values ( 0.3 2 + 0.4 2 + ( − 0.866 ) 2 = 1 {\displaystyle 0.3^{2}+0.4^{2}+(-0.866)^{2}=1} ). The sign of the z-coordinate (blue channel) must be flipped to match the normal map's normal vector with that of the eye (the viewpoint or camera) or the light vector. Since negative z values mean that the vertex is in front of the camera (rather than behind the camera) this convention guarantees that the surface shines with maximum strength precisely when the light vector and normal vector are coincident. Normal mapping in video games Interactive normal map rendering was originally only possible on PixelFlow, a parallel rendering machine built at the University of North Carolina at Chapel Hill.[citation needed] It was later possible to perform normal mapping on high-end SGI workstations using multi-pass rendering and framebuffer operations or on low end PC hardware with some tricks using paletted textures. However, with the advent of shaders in personal computers and game consoles, normal mapping became widespread in the early 2000s, with some of the first games to implement it being Evolva (2000), Giants: Citizen Kabuto, and Virtua Fighter 4 (2001). Normal mapping's popularity for real-time rendering is due to its good quality to processing requirements ratio versus other methods of producing similar effects. Much of this efficiency is made possible by distance-indexed detail scaling, a technique which selectively decreases the detail of the normal map of a given texture (cf. mipmapping), meaning that more distant surfaces require less complex lighting simulation. Many authoring pipelines use high resolution models baked into low/medium resolution in-game models augmented with normal maps. Basic normal mapping can be implemented in any hardware that supports palettized textures. The first game console to have specialized normal mapping hardware was the Sega Dreamcast. However, Microsoft's Xbox was the first console to widely use the effect in retail games. Out of the sixth generation consoles[citation needed], only the PlayStation 2's GPU lacks built-in normal mapping support, though it can be simulated using the PlayStation 2 hardware's vector units. Games for the Xbox 360 and the PlayStation 3 rely heavily on normal mapping and were the first game console generation to make use of parallax mapping. The Nintendo 3DS has been shown to support normal mapping, as demonstrated by Resident Evil: Revelations and Metal Gear Solid 3: Snake Eater. See also References External links
========================================
[SOURCE: https://en.wikipedia.org/wiki/Specular_mapping] | [TOKENS: 470]
Contents Specularity Specularity is the visual appearance of specular reflections. In computer graphics In computer graphics, it means the quantity used in three-dimensional (3D) rendering which represents the amount of reflectivity a surface has. It is a key component in determining the brightness of specular highlights, along with shininess to determine the size of the highlights. It is frequently used in real-time computer graphics and ray tracing, where the mirror-like specular reflection of light from other surfaces is often ignored (due to the more intensive computations required to calculate it), and the specular reflection of light directly from point light sources is modeled as specular highlights. A materials system may allow specularity to vary across a surface, controlled by additional layers of texture maps. Early shaders included a parameter called "Specularity". CG Artists, confused by this term discovered by experimentation that the manipulation of this parameter would cause a reflected highlight from a light source to appear and disappear and therefore misinterpreted "specularity" to mean "light highlights". In fact "Specular" is defined in optics as Optics. (of reflected light) directed, as from a smooth, polished surface (opposed to diffuse ). A specular surface is a highly smooth surface. When the surface is very smooth, the reflected highlight is easy to see. As the surface becomes rougher, the reflected highlights gets broader and dimmer. This is a more "diffused" reflection. In seismology In the context of seismic migration, specularity is defined as the cosine of the angle made by the surface normal vector and the angle bisector of the angle defined by the directions of the incident and diffracted rays. For a purely specular seismic event the value of specularity should be equal to unity, as the angle between the surface normal vector and the angle bisector should be zero, according to Snell's Law. For a diffractive seismic event, the specularity can be sub-unitary. During the seismic migration, one can filter each seismic event according to the value of specularity, in order to enhance the contribution of diffractions in the seismic image. Alternatively, the events can be separated in different sub-images according to the value of specularity to produce a specularity gather. See also References This computer graphics–related article is a stub. You can help Wikipedia by adding missing information.
========================================
[SOURCE: https://en.wikipedia.org/wiki/Multitexturing] | [TOKENS: 4408]
Contents Texture mapping 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 apart so that it can be unfolded into a 2D coordinate space (UV space). Semantic Texture mapping can multiply refer to (1) the task of unwrapping a 3D model (converting the surface of a 3D model into a 2D texture map), (2) applying a 2D texture map onto the surface of a 3D model, and (3) the 3D software algorithm that performs both tasks. A texture map refers to a 2D image ("texture") that adds visual detail to a 3D model. The image can be stored as a raster graphic. A texture that stores a specific property—such as bumpiness, reflectivity, or transparency—is also referred to as a color map or roughness map. The coordinate space that converts from a 3D model's 3D space into a 2D space for sampling from the texture map is variously called UV space, UV coordinates, or texture space. Algorithm The following is a simplified explanation of how an algorithm could work to render an image: History The original technique was pioneered by Edwin Catmull in 1974 as part of his doctoral thesis. Texture mapping originally referred to diffuse mapping, a method that simply mapped pixels from a texture to a 3D surface ("wrapping" the image around the object). In recent decades, the advent of multi-pass rendering, multitexturing, mipmaps, and more complex mappings such as height mapping, bump mapping, normal mapping, displacement mapping, reflection mapping, specular mapping, occlusion mapping, and many other variations on the technique (controlled by a materials system) have made it possible to simulate near-photorealism in real time by vastly reducing the number of polygons and lighting calculations needed to construct a realistic and functional 3D scene. Texture maps A texture map is an image applied ("mapped") to the surface of a shape or polygon. This may be a bitmap image or a procedural texture. They may be stored in common image file formats, referenced by 3D model formats or material definitions, and assembled into resource bundles. 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. 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. Texture maps usually contain RGB color data (either stored as direct color, compressed formats, or indexed color), and sometimes an additional channel for alpha blending (RGBA) especially for billboards and decal overlay textures. It is possible to use the alpha channel (which may be convenient to store in formats parsed by hardware) for other uses such as specularity. Multiple texture maps (or channels) may be combined for control over specularity, normals, displacement, or subsurface scattering, 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 textures with multiple faces for environment mapping. Texture maps may be acquired by scanning or digital photography, designed in image manipulation software such as GIMP or Photoshop, or painted onto 3D surfaces directly in a 3D paint tool such as Mudbox or ZBrush. 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. This might be accomplished via planar projection or, alternatively, cylindrical or spherical 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" mapping from every piece of a surface (which is important for render mapping and light mapping, also known as baking). Texture mapping maps the model surface (or screen space 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 may be performed approximately by texture-space operations. Multitexturing is the use of more than one texture at a time on a polygon. For instance, a light map 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 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, for greater fidelity. Another multitexture technique is bump mapping, 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 video games, as graphics hardware has become powerful enough to accommodate it in real-time. The way that samples (e.g. when viewed as pixels on the screen) are calculated from the texels (texture pixels) is governed by texture filtering. The cheapest method is to use the nearest-neighbour interpolation, but bilinear interpolation or trilinear interpolation between mipmaps are two commonly used alternatives which reduce aliasing or jaggies. In the event of a texture coordinate being outside the texture, it is either clamped or wrapped. Anisotropic filtering better eliminates directional artefacts when viewing textures from oblique viewing angles. Texture streaming is a means of using data streams 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. As an optimization, it is possible to render detail from a complex, high-resolution model or expensive process (such as global illumination) into a surface texture (possibly on a low-resolution model). This technique is called baking (or render mapping) and 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) have used this technique. The original Quake software engine used on-the-fly baking to combine light maps and colour maps in a process called 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 linearly interpolates texture coordinates across a surface, making it the fastest form of texture mapping. Some software and hardware (such as the original PlayStation) project 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 or by an incremental error algorithm akin to Bresenham's line algorithm. In contrast to perpendicular polygons, this leads to noticeable distortion with perspective transformations (as shown in the figure: the checker box texture appears bent), especially as primitives near the camera. This distortion can be reduced by subdividing polygons into smaller polygons. Using quad primitives for rectangular objects can look less incorrect than if those rectangles were split into triangles. However, since interpolating four 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, offered efficient quad primitives. With perspective correction, triangles become equivalent to quad primitives 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. Affine linear interpolation across that horizontal span will look correct because every pixel along that line is the same distance from the viewer. Perspective correct texturing accounts for the vertices' positions in 3D space rather than simply interpolating coordinates in 2D screen space. While achieving the correct visual effect, perspective correct texturing is more expensive to calculate. To perform perspective correction of the texture coordinates u {\displaystyle u} and v {\displaystyle v} , with z {\displaystyle z} being the depth component from the viewer's point of view, it is possible to take advantage of the fact that the values 1 z {\displaystyle {\frac {1}{z}}} , u z {\displaystyle {\frac {u}{z}}} , and v z {\displaystyle {\frac {v}{z}}} are linear in screen space across the surface being textured. In contrast, the original z {\displaystyle z} , u {\displaystyle u} , and v {\displaystyle v} , before the division, are not linear across the surface in screen space. It is therefore possible to linearly interpolate these reciprocals across the surface, computing corrected values at each pixel, to produce a perspective correct texture mapping. To do this, the reciprocals at each vertex of the geometry (three points for a triangle) are calculated. Vertex n {\displaystyle n} has reciprocals u n z n {\displaystyle {\frac {u_{n}}{z_{n}}}} , v n z n {\displaystyle {\frac {v_{n}}{z_{n}}}} , and 1 z n {\displaystyle {\frac {1}{z_{n}}}} . Then, linear interpolation can be done on these reciprocals between the n {\displaystyle 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 {\displaystyle u_{i},v_{i}} and 1 z i {\displaystyle {\frac {1}{z_{i}}}} (reciprocal z i {\displaystyle z_{i}} ). However, as our division by z {\displaystyle z} altered their coordinate system, this u i , v i {\displaystyle u_{i},v_{i}} cannot be used as texture coordinates. To correct back to the u , v {\displaystyle u,v} space, the corrected z {\displaystyle z} is calculated by taking the reciprocal once again: z c o r r e c t = 1 1 z i {\displaystyle z_{correct}={\frac {1}{\frac {1}{z_{i}}}}} . This is then used to correct the u i , v i {\displaystyle u_{i},v_{i}} coordinates: u c o r r e c t = u i ⋅ z i {\displaystyle u_{correct}=u_{i}\cdot z_{i}} and v c o r r e c t = v i ⋅ z i {\displaystyle v_{correct}=v_{i}\cdot z_{i}} . This correction makes it so that the difference from pixel to pixel between texture coordinates is smaller in parts of the polygon that are closer to the viewer (stretching the texture wider) and is larger in parts that are farther away (compressing the texture). Affine texture mapping directly interpolates a texture coordinate u α {\displaystyle u_{\alpha }} between two endpoints u 0 {\displaystyle u_{0}} and u 1 {\displaystyle u_{1}} : u α = ( 1 − α ) u 0 + α u 1 {\displaystyle u_{\alpha }=(1-\alpha )u_{0}+\alpha u_{1}} where 0 ≤ α ≤ 1 {\displaystyle 0\leq \alpha \leq 1} . Perspective correct mapping interpolates after dividing by depth z {\displaystyle z} , then uses its interpolated reciprocal to recover the correct coordinate: u α = ( 1 − α ) u 0 z 0 + α u 1 z 1 ( 1 − α ) 1 z 0 + α 1 z 1 {\displaystyle u_{\alpha }={\frac {(1-\alpha ){\frac {u_{0}}{z_{0}}}+\alpha {\frac {u_{1}}{z_{1}}}}{(1-\alpha ){\frac {1}{z_{0}}}+\alpha {\frac {1}{z_{1}}}}}} 3D graphics hardware typically supports perspective correct texturing. Various techniques have evolved for rendering texture mapped geometry into images with different quality and precision trade-offs, which can be applied to both software and hardware. Classic software texture mappers generally only performed simple texture mapping with one lighting effect at most (typically applied through a lookup table), and the perspective correctness was about 16 times more expensive.[compared to?] The Doom engine restricted the world to vertical walls and horizontal floors and 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 and 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 which allowed the appearance of greater freedom while using the same rendering technique. Some engines were able to render texture mapped heightmaps (e.g. Nova Logic'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. Every triangle can be further subdivided into groups of about 16 pixels in order to achieve two goals: keeping the arithmetic mill busy at all times and producing faster arithmetic results.[vague] 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 made extensive use of this because it only supported affine mapping in hardware and had a relatively high triangle throughput compared to its peers. Software renderers generally prefer 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), thus lessening the overhead further. Another reason is that affine texture mapping does not fit into the low number of CPU registers of the x86 CPU; the 68000 and RISC processors are much more suited for that approach. 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. As the polygons are rendered independently, 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.[original research?] One other technique is to approximate the perspective with a faster calculation, such as a polynomial. A second uses the 1 z i {\textstyle {\frac {1}{z_{i}}}} value of the last two drawn pixels to linearly extrapolate the next value. For the latter, the division is then done starting from those values so that all that has to be divided is a small remainder. However, the amount of bookkeeping needed makes this technique too slow on most systems.[citation needed] A third technique, used by the Build Engine (used, most notably, in Duke Nukem 3D), builds on the constant distance trick used by the Doom engine by finding and rendering along the line of constant distance for arbitrary polygons. 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) and broadcast digital video effects machines such as the Ampex ADO. Texture mapping hardware later appeared in arcade cabinets, consumer video game consoles, and PC video cards in the mid-1990s. In flight simulations, texture mapping provided important motion and altitude cues necessary for pilot training not available on untextured surfaces. Additionally, texture mapping was implemented so that real-time processing of prefiltered texture patterns stored in memory could be accessed by the video processor in real-time. Modern graphics processing units (GPUs) provide specialised fixed function units called texture samplers, or texture mapping units, to perform texture mapping, usually with trilinear filtering or better multi-tap anisotropic filtering 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 implementations combine texture mapping with hidden-surface determination in tile-based deferred rendering or scanline rendering; such systems only fetch the visible texels at the expense of using greater workspace for transformed vertices. Most systems have settled on the z-buffering approach, which can still reduce the texture mapping workload with front-to-back sorting. On earlier graphics hardware, there were two competing paradigms of how to deliver a texture to the screen: Of these methods, inverse texture mapping has become standard in modern hardware. 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 of this method 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 is that the memory access pattern in the texture space 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 texture mapping, but can also be adapted for perspective correctness. 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. This was used by some hardware, such as the 3DO, the Sega Saturn 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 the § Affine texture mapping section above). The NV1 hardware also allowed a quadratic interpolation mode to provide an even better approximation of perspective correctness. UV mapping became an important technique for 3D modelling and assisted in clipping the texture correctly when the primitive went past the edge of the screen, but existing hardware did not provide effective implementations of this. These shortcomings could have been addressed with further development, but GPU design has mostly shifted toward using the inverse mapping technique. Applications Beyond 3D rendering, the availability of texture mapping hardware has inspired its use for accelerating other tasks: It is possible to use texture mapping hardware to accelerate both the reconstruction of voxel data sets from tomographic scans, and to visualize the results. Many user interfaces use texture mapping to accelerate animated transitions of screen elements, e.g. Exposé in Mac OS X. See also References Software External links
========================================