Table of Contents Glide Programming Guide



Download 6.22 Mb.
Page14/106
Date03.02.2023
Size6.22 Mb.
#60547
1   ...   10   11   12   13   14   15   16   17   ...   106
GLIDEPGM

2Colors


The color components are in the range [0..255] where 0 is black and 255 is maximum intensity. Colors should be clamped to this range.
Glide supports four different color byte orderings: RGBA, ARGB, BGRA, and ABGR. Color byte ordering determines how linear frame buffer writes and color arguments passed to the constant color functions (see Chapter Chapter 5. ) are interpreted. Color ordering is established when Glide and the Voodoo Graphics system are initialized (see Chapter Chapter 3. ).
When the terms “RGB” and “RGBA” appear in this manual, they typically refer to any color system that represents red, green, blue, and optionally, alpha, as separate components, regardless of the byte order or component width. The exceptions will be clearly recognizable in discussions about specific color resolution and format.

3Texture Coordinates


Glide uses texture coordinates in the range [–32768..32767] and refers to them as (s,t) pairs, similar to the naming convention of OpenGL. A texture contains texels with (s,t) coordinates in the range [0..256.0]; the texture may be replicated many times to cover a surface by mapping the texture coordinates modulo 256 to a texel in the texture. The Voodoo Graphics subsystem iterates s/w and t/w, so s and t must be divided by w (or multiplied by oow) before storing them in the GrVertex structure.
The w term iterated by the SST-1 is actually 1/w or the reciprocal of the homogeneous coordinate. The valid range for 1/w is [–4096..61439]. Normally, the homogeneous coordinate is clipped to a positive range of [1..far] and so its reciprocal is in the range [1..1/far]. Negative values should be avoided. Each TMU has its own s, t, and w values. Normally, they will be the same as the w in the Pixelfx. However, in certain cases they will be different. For example, projected textures have a different w value than non-projected textures. Projected textures iterate q/w where w is the homogeneous distance from the eye and q is the homogeneous distance from the projected source. In this case, q/w has a valid range of [–4096..61439].
Mipmapping [WILL83] is a method of organizing several pre-filtered texture maps into a single logical entity used for anti-aliased texture mapping. The term mipmap is sometimes used to describe a pyramidal organization of gradually smaller, filtered sub-textures or an individual texture map within such an organization. Glide adopts the original convention that defines the term mipmap to mean the entire group of textures that comprise a single pyramidal data structure. Individual textures within a mipmap are referred to as mipmap levels.

Download 6.22 Mb.

Share with your friends:
1   ...   10   11   12   13   14   15   16   17   ...   106




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

    Main page