<P> Affine texture mapping is cheapest to linearly interpolate texture coordinates across a surface . Some software and hardware systems (such as the original PlayStation), project 3D vertices onto the screen during rendering and linearly interpolate the texture coordinates in screen space between them (inverse - texture mapping). This may be done by incrementing fixed point UV coordinates or by an incremental error algorithm akin to Bresenham's line algorithm . </P> <P> This leads to noticeable distortion with perspective transformations (see figure--textures (the checker boxes) appear bent), especially as primitives near the camera . Such distortion may be reduced with subdivision . </P> <P> Perspective correct texturing accounts for the vertices' positions in 3D space rather than simply interpolating coordinates in 2D screen space . This achieves the correct visual effect but it is more expensive to calculate . Instead of interpolating the texture coordinates directly, the coordinates are divided by their depth (relative to the viewer) and the reciprocal of the depth value is also interpolated and used to recover the perspective - correct coordinate . This correction makes it so that in parts of the polygon that are closer to the viewer the difference from pixel to pixel between texture coordinates is smaller (stretching the texture wider) and in parts that are farther away this difference is larger (compressing the texture). </P> <Dl> <Dd> 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) ^ ()): <Dl> <Dd> 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) </Dd> </Dl> </Dd> <Dd> Perspective correct mapping interpolates after dividing by depth z (\ displaystyle z_ () ^ ()), then uses its interpolated reciprocal to recover the correct coordinate: <Dl> <Dd> 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)))))) </Dd> </Dl> </Dd> </Dl>

How do you add texture to faces in computer graphics