Table of Contents Glide Programming Guide



Download 6.22 Mb.
Page93/106
Date03.02.2023
Size6.22 Mb.
#60547
1   ...   89   90   91   92   93   94   95   96   ...   106
GLIDEPGM

1In This Chapter


The Glide Utility Library is a set of utility functions that are built on top of the lower-level Glide routines presented in the preceding chapters. Many are convenience routines that provide higher-level services: functional descriptions of color, alpha, and texture combine functions, texture memory management services, and so on. Some of the Glide Utility Library functions have already been described: the routines to clip and draw triangles in Chapter Chapter 4. , the functions that create fog tables in Chapter Chapter 8. , or the functions that download mipmaps and decompression tables from .3DF files in Chapter Chapter 10. .
In this chapter, you will discover

  • a different way to configure the color combine, alpha combine, and texture combine units

  • a different way to manage texture memory

  • a higher level way to read and write the linear frame buffer

2A Higher Level Color Combine Function


Chapter 4 introduced the grColorCombine() function; it provides a low-level way to configure the color combine unit. The guColorCombineFunction() provides a higher level mechanism for controlling common rendering modes without manipulating individual registers within the hardware.
void guColorCombineFunction( GrColorCombineFunction_t function )

The argument, function, specifies one of fourteen color combine functions. Table Glide Utilities .1 lists the Glide constants that define the color combine function and the effects than can be achieved with that function. The default color combine function is undefined, so an application must set the color combine function before executing any rendering commands. Refer to the guColorCombineFunction() page in the Glide 2.2 Reference Manual for more information.



  1. Table Glide Utilities .1 Color combine functions.



function

effect

GR_COLORCOMBINE_ZERO

0x00 (black) for each component

GR_COLORCOMBINE_ITRGB

Gouraud shading

GR_COLORCOMBINE_DECAL_TEXTURE

texture

GR_COLORCOMBINE_TEXTURE_TIMES_CCRGB

flat-shaded texture using the constant color set by grConstantColorValue() as the shading value

GR_COLORCOMBINE_TEXTURE_TIMES_ITRGB

Gouraud-shaded texture

GR_COLORCOMBINE_TEXTURE_TIMES_ITRGB_ADD_ALPHA

Gouraud-shaded texture + alpha

GR_COLORCOMBINE_TEXTURE_TIMES_ALPHA

texture * alpha

GR_COLORCOMBINE_TEXTURE_ADD_ITRGB

texture + iterated RGB

GR_COLORCOMBINE_TEXTURE_SUB_ITRGB

texture – iterated RGB

GR_COLORCOMBINE_CCRGB

flat shading using the constant color set by grConstantColorValue()

GR_COLORCOMBINE_CCRGB_BLEND_ITRGB_ON_TEXALPHA

blend between constant color and iterated RGB using an alpha texture, where alpha of 0 and 1 correspond to constant color and iterated RGB respectively

GR_COLORCOMBINE_DIFF_SPEC_A

texture * a + iterated RGB

GR_COLORCOMBINE_DIFF_SPEC_B

texture * iterated RGB + a

GR_COLORCOMBINE_ONE

0xFF (white) for each component



Download 6.22 Mb.

Share with your friends:
1   ...   89   90   91   92   93   94   95   96   ...   106




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

    Main page