Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Texture mapping
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Affine texture mapping=== [[File:Perspective correct texture mapping.svg|thumb|400px|Because affine texture mapping does not take into account the depth information about a polygon's vertices, where the polygon is not perpendicular to the viewer, it produces a noticeable defect, especially when rasterized as triangles.]] '''Affine texture mapping''' linearly interpolates texture coordinates across a surface, and so is the fastest form of texture mapping. Some software and hardware (such as the original [[PlayStation (console)|PlayStation]]) [[3D projection|project]] vertices in 3D space onto the screen during rendering and [[Linear interpolation|linearly interpolate]] the texture coordinates ''in screen space'' between them. This may be done by incrementing [[Fixed point arithmetic|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 (see figure: the checker box texture appears bent), especially as primitives near the [[3d camera coordinate system|camera]]. Such distortion may be reduced with the subdivision of the polygon into smaller ones. For the case of rectangular objects, using quad primitives can look less incorrect than the same rectangle split into triangles, but because interpolating 4 points adds complexity to the rasterization, most early implementations preferred triangles only. Some hardware, such as the [[#Forward texture mapping|forward texture mapping]] used by the Nvidia [[NV1]], was able to offer efficient quad primitives. With perspective correction (see below) triangles become equivalent and this advantage disappears. [[File:Affine texture mapping tri vs quad.svg|thumb|400px|For rectangular objects, especially when perpendicular to the view, linearly interpolating across a quad can give a superior affine result versus the same rectangle split into two affine triangles.]] For rectangular objects that are at right angles to the viewer, like floors and walls, the perspective only needs to be corrected in one direction across the screen, rather than both. The correct perspective mapping can be calculated at the left and right edges of the floor, and then an affine linear interpolation across that horizontal span will look correct, because every pixel along that line is the same distance from the viewer.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)