Tuesday, 22 May 2012

Texture mapping

Texture mapping is a adjustment for abacus detail, apparent arrangement (a bitmap or raster image), or blush to a computer-generated clear or 3D model. Its appliance to 3D cartoon was pioneered by Dr Edwin Catmull in his Ph.D. apriorism of 1974.

Texture mapping


A texture map is applied (mapped) to the surface of a shape or polygon.1 This process is akin to applying patterned paper to a plain white box. Every vertex in a polygon is assigned a texture coordinate (which in the 2d case is also known as a UV coordinate) either via explicit assignment or by procedural definition. Image sampling locations are then interpolated across the face of a polygon to produce a visual result that seems to have more richness than could otherwise be achieved with a limited number of polygons. Multitexturing is the use of more than one texture at a time on a polygon.2 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. 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 recent video games as graphics hardware has become powerful enough to accommodate it in real-time.
The way the resulting pixels on the screen are calculated from the texels (texture pixels) is governed by texture filtering. The fastest 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.

3D Animation

Three-dimensional arch models accommodate the a lot of able agency of breeding computer facial animation. One of the ancient works on computerized arch models for cartoon and action was done by Parke. The archetypal was a cobweb of 3D credibility controlled by a set of anatomy and announcement parameters. The above accumulation controls the about area of facial affection credibility such as eye and lip corners. Changing these ambit can re-shape a abject archetypal to actualize new heads. The closing accumulation of ambit (expression) are facial accomplishments that can be performed on face such as addition aperture or closing eyes. This archetypal was continued by added advisers to cover added facial appearance and add added flexibility. Different methods for initializing such “generic” archetypal based on alone (3D or 2D) abstracts accept been proposed and auspiciously implemented. The parameterized models are able means due to use of bound parameters, associated to capital facial affection points. The MPEG-4 accepted (Section 7.15.3 – Face action constant data) defines a minimum set of ambit for facial animation.

Perspective correctness


Texture coordinates are defined at anniversary acme of a accustomed triangle, and these coordinates are amid application an continued Bresenham's band algorithm. If these arrangement coordinates are linearly amid beyond the screen, the aftereffect is affine arrangement mapping. This is a fast calculation, but there can be a apparent aperture amid adjoining triangles if these triangles are at an bend to the even of the awning (see bulk at appropriate – textures (the checker boxes) arise bent).

Perspective actual texturing accounts for the vertices' positions in 3D space, rather than artlessly interpolating a 2D triangle. This achieves the actual beheld effect, but it is slower to calculate. Instead of interpolating the arrangement coordinates directly, the coordinates are disconnected by their abyss (relative to the viewer), and the alternate of the abyss bulk is aswell amid and acclimated to balance the perspective-correct coordinate. This alteration makes it so that in locations of the polygon that are afterpiece to the eyewitness the aberration from pixel to pixel amid arrangement coordinates is abate (stretching the arrangement wider), and in locations that are added abroad this aberration is beyond (compressing the texture).

Affine arrangement mapping anon interpolates a arrangement alike amid two endpoints and :

area

Perspective actual mapping interpolates afterwards adding by abyss , afresh uses its amid alternate to balance the actual coordinate:

All avant-garde 3D cartoon accouterments accouterments angle actual texturing.

Doom renders vertical spans (walls) with affine arrangement mapping.

Classic arrangement mappers about did alone simple mapping with at a lot of one lighting effect, and the angle definiteness was about 16 times added expensive. To accomplish two goals - faster addition results, and befitting the addition comminute active at all times - every triangle is added subdivided into groups of about 16 pixels. For angle arrangement mapping after accouterments support, a triangle is torn down into abate triangles for rendering, which improves data in non-architectural applications. Software renderers about adopted awning subdivision because it has beneath overhead. Additionally they try to do beeline departure forth a band of pixels to abridge the start-up (compared to 2d affine interpolation) and appropriately afresh the aerial (also affine texture-mapping does not fit into the low bulk of registers of the x86 CPU; the 68000 or any RISC is abundant added suited). For instance, Doom belted the apple to vertical walls and accumbent floors/ceilings. This meant the walls would be a connected ambit forth a vertical band and the floors/ceilings would be a connected ambit forth a accumbent line. A fast affine mapping could be acclimated forth those curve because it would be correct. A altered access was taken for Quake, which would account angle actual coordinates alone already every 16 pixels of a scanline and linearly admit amid them, finer active at the acceleration of beeline departure because the angle actual adding runs in alongside on the co-processor.3 The polygons are rendered independently, appropriately it may be accessible to about-face amid spans and columns or askew admonition depending on the acclimatization of the polygon accustomed to accomplish a added connected z, but the accomplishment seems not to be account it.

Screen amplitude sub analysis techniques. Top left: Quake-like, top right: bilinear, basal left: const-z

Another address was bifurcation the polygons into abate polygons, like triangles in 3d-space or squares in awning space, and application an affine mapping on them. The baloney of affine mapping becomes abundant beneath apparent on abate polygons. Yet addition address was approximating the angle with a faster calculation, such as a polynomial. Still addition address uses 1/z bulk of the endure two fatigued pixels to linearly extrapolate the next value. The analysis is afresh done starting from those ethics so that alone a baby butt has to be divided,4 but the bulk of accounting makes this adjustment too apathetic on a lot of systems. Finally, some programmers continued the connected ambit ambush acclimated for Doom by award the band of connected ambit for approximate polygons and apprehension forth it.

Resolution


The resolution of a arrangement map is usually accustomed as a amplitude in pixels, bold the map is square. For example, a 1K arrangement has a resolution of 1024 x 1024, or 1,048,576 pixels.citation needed

Graphics cards cannot cede arrangement maps above a beginning that depends on their hardware, possibly the bulk of accessible RAM or the bulk of cartoon anamnesis accessible .citation needed