3D graphics eBook - Course Materials Repository
3D graphics eBook - Course Materials Repository
3D graphics eBook - Course Materials Repository
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Texture mapping 216<br />
constant distance along a vertical line and the floors/ceilings<br />
would be a constant distance along a horizontal line. A fast affine<br />
mapping could be used along those lines because it would be<br />
correct. A different approach was taken for Quake, which would<br />
calculate perspective correct coordinates only once every 16 pixels<br />
of a scanline and linearly interpolate between them, effectively<br />
running at the speed of linear interpolation because the perspective<br />
correct calculation runs in parallel on the co-processor. [3] The<br />
polygons are rendered independently, hence it may be possible to<br />
switch between spans and columns or diagonal directions<br />
depending on the orientation of the polygon normal to achieve a<br />
more constant z, but the effort seems not to be worth it.<br />
Another technique was subdividing the polygons into smaller<br />
polygons, like triangles in 3d-space or squares in screen space, and<br />
using an affine mapping on them. The distortion of affine mapping<br />
Screen space sub division techniques. Top left:<br />
Quake-like, top right: bilinear, bottom left: const-z<br />
becomes much less noticeable on smaller polygons. Yet another technique was approximating the perspective with a<br />
faster calculation, such as a polynomial. Still another technique uses 1/z value of the last two drawn pixels to linearly<br />
extrapolate the next value. The division is then done starting from those values so that only a small remainder has to<br />
be divided, [4] but the amount of bookkeeping makes this method too slow on most systems. Finally, some<br />
programmers extended the constant distance trick used for Doom by finding the line of constant distance for<br />
arbitrary polygons and rendering along it.<br />
Resolution<br />
The resolution of a texture map is usually given as a width in pixels, assuming the map is square. For example, a 1K<br />
texture has a resolution of 1024 x 1024, or 1,048,576 pixels.<br />
Graphics cards cannot render texture maps beyond a threshold that depends on their hardware, possibly the amount<br />
of available RAM.<br />
References<br />
[1] Jon Radoff, Anatomy of an MMORPG, http:/ / radoff. com/ blog/ 2008/ 08/ 22/ anatomy-of-an-mmorpg/<br />
[2] Blythe, David. Advanced Graphics Programming Techniques Using OpenGL (http:/ / www. opengl. org/ resources/ code/ samples/ sig99/<br />
advanced99/ notes/ notes. html). Siggraph 1999. (see: Multitexture (http:/ / www. opengl. org/ resources/ code/ samples/ sig99/ advanced99/<br />
notes/ node60. html))<br />
[3] Abrash, Michael. Michael Abrash's Graphics Programming Black Book Special Edition. The Coriolis Group, Scottsdale Arizona, 1997. ISBN<br />
1-57610-174-6 ( PDF (http:/ / www. gamedev. net/ reference/ articles/ article1698. asp)) (Chapter 70, pg. 1282)<br />
[4] US 5739818 (http:/ / v3. espacenet. com/ textdoc?DB=EPODOC& IDX=US5739818), Spackman, John Neil, "Apparatus and method for<br />
performing perspectively correct interpolation in computer <strong>graphics</strong>", issued 1998-04-14