Language:EN
Pages: 2
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
tell opengl use texture unit color values for arg

Tell opengl use texture unit color values for arg gltexenvi

370

CHAPTER 9

Texture Mapping: Beyond the Basics

Function

GL_REPLACE
GL_MODULATE
GL_ADD
GL_ADD_SIGNED
GL_INTERPOLATE
GL_SUBTRACT

TABLE 9.5

Texture Combiner Sources

ment variable GL_TEXTURE_ENV_COLOR

GL_PRIMARY_COLOR

glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_TEXTURE0);

You also have some additional control over what values are used from a given source for each argument. To set these operands, you use the constant GL_OPERANDx_RGB or
GL_OPERANDx_ALPHA, where x is 0, 1, or 2. The valid operands and their meanings are given in Table 9.6.

Point Sprites 371
Constant
GL_SRC_COLOR

The color values from the source. This may not be used with

GL_OPERANDx_ALPHA.

One’s complement (1-value) of the alpha values from the source.

For example, if you have two textures loaded on the first two texture units, and you want to multiply the color values from both textures during the texture application, you would set it up as shown here:

// Tell OpenGL to use texture unit 0’s color values for Arg0

glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_TEXTURE0);

Finally, with texture combiners, you can also specify a constant RGB or alpha scaling factor. The default parameters for these are as shown here:

glTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE, 1.0f);

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Dr Billy Hussain

PageId: DOCFF1E89F