Table of Contents Glide Programming Guide


Avoiding Redundant State Setting



Download 6.22 Mb.
Page99/106
Date03.02.2023
Size6.22 Mb.
#60547
1   ...   95   96   97   98   99   100   101   102   ...   106
GLIDEPGM

3Avoiding Redundant State Setting


If an application depth sorts all the polygons in a scene, the arbitrary order in which polygons are rendered can potentially cause an immense amount of redundant state information to be passed to the hardware. This is a difficult problem to solve, however, the following guidelines should assist when attempting to efficiently maintain state:

  • use material libraries to clump together attributes into “materials”. Change states en masse whenever a new material becomes current, but only change the current material when necessary.

  • use intelligent object rendering code that renders similar triangles (in terms of state attributes) together to minimize unnecessary state updates

4Avoiding Screen Clears by Rendering Background Polygons


If an application does not need to clear the alpha or depth buffers, it can forego clearing the display buffer by rendering large background polygons first. For example, a flight simulator will typically render large sky and ground polygons that will effectively cover the entire screen, removing the need to clear the display buffer.

5Using LOD Bias To Control Texture Aliasing


LOD calculations computed for mipmapping can be biased to finely control the point at which mipmap levels are crossed. The LOD bias for a texture is specified by calling grTexLodBiasValue(). For bilinear, blended, mipmapped, non-mipmap dithered, non-mipmap-interpolated textures, an LOD bias value of 0.5 is typically sufficient. For bilinear, blended, mipmapped, mipmap interpolated textures, an LOD bias value of –3/8 is typically sufficient.
However, the choice of an LOD bias value is highly dependent on the frequency of a texture. If textures are fairly high in frequency, then a larger LOD bias may be required to reduce texture aliasing artifacts.

6Linear z Buffering and Coordinate System Ranges


The Voodoo Graphics hardware supports linear z buffering by storing the 16-bit whole part of any z values passed to the hardware. A side effect of this is that the precision of the z buffer tends to be concentrated very close to the viewer. Therefore z buffer “poke through” may occur as a result of the compression of precision close to the viewer.

Download 6.22 Mb.

Share with your friends:
1   ...   95   96   97   98   99   100   101   102   ...   106




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

    Main page