Table of Contents Glide Programming Guide



Download 6.22 Mb.
Page59/106
Date03.02.2023
Size6.22 Mb.
#60547
1   ...   55   56   57   58   59   60   61   62   ...   106
GLIDEPGM

4Texel Coordinate Systems


All square texture maps have their origin at (s,t) = (0,0) and their opposite corner at (256,256). This is true even for a 1´1 texture map. Note that these texture coordinates are before division by w. Texture coordinate (0.5, 0.5) represents the exact center of the first texel in a 256×256 texture map and (255.5, 255.5) represents the exact center of the texel in the opposite corner; (256.5, 256.5) wraps to the center of the first texel. In general, the center of the first texel in an 2n×2n texture map (where 0£n£8) is at (128/2n, 128/2n).
Rectangular textures also have their origin at (0, 0). If the rectangular texture is wider than tall (s is larger than t) then the opposite corner is at (256, n) where n/256=t/s. For example, if the texture is four times as wide as high, then n=64. Likewise, if the rectangular texture is taller than it is wide, the opposite corner is at (n, 256) and n/256=s/t. Therefore, the longer texture axis always has texture coordinates running from 0 to 256, while the shorter texture axis is proportionally smaller. Table Texture Mapping.2 shows the texel coordinates of the first and last pixel for all supported aspect ratios and texture map dimensions.
Figure Texture Mapping.2 Mapping texels onto texture maps.
The textures shown below all have a 1:2 aspect ratio, and range in size from 32´64 to 1´2. In each one, the texture coordinates (s,t) range from (0,0) to (128,256). Thus, the texels get bigger (in terms of coverage of coordinate space) as the texture map size decreases. The degenerate case of 1´1 is shown for completeness.

All texture mapping capabilities of the Voodoo Graphics subsystem are handled in the TMU, which includes logic to support true-perspective texture mapping (dividing every pixel by w), per-pixel level-of-detail (LOD) mipmapping, and bilinear filtering. Additionally, TMU implements texture mapping techniques such as detail texture mapping, projected texture mapping, and trilinear filtering. While point sampled and bilinear filtering are single pass operations, single TMU systems require two passes for trilinear texture filtering. Multiple TMU systems support trilinear texture filtering as a single-pass operation. Note that regardless of the number of TMUs in a given Voodoo Graphics system, there is no performance difference between point-sampled and bilinear filtered texture-mapped rendering, and no performance penalty for per-pixel mipmapping or perspective correction.



  1. Table Texture Mapping.2 Mapping pixels to texture coordinates in texture maps.

The texel coordinate on the long side of a texture map always goes from 0 to 256, regardless of the size of the texture map. Since texels are square, the texture coordinate on the short side of the texture map is scaled accordingly: it ranges from 0 to 256·(the ratio of the short to the long side). The degenerate cases are shaded.

if the aspect ratio is

and the texture map size is

a texel is

the center of the first texel is at

the center of the last texel is at

1:1

256×256

1×1

(.5, .5)

(255.5, 255.5)

(a square texture)

128×128

2×2

(1, 1)

(255, 255)




64×64

4×4

(2, 2)

(254, 254)




32×32

8×8

(4, 4)

(252, 252)




16×16

16×16

(8, 8)

(248, 248)




8×8

32×32

(16, 16)

(240, 240)




4×4

64×64

(32, 32)

(224, 224)




2×2

128×128

(64, 64)

(192, 192)




1×1

256×256

(128, 128)

(128, 128)

2:1 or 1:2


Download 6.22 Mb.

Share with your friends:
1   ...   55   56   57   58   59   60   61   62   ...   106




The database is protected by copyright ©ininet.org 2024
send message

    Main page