Frumpy
03-23-2001, 12:43 PM
Need more help guys. Previously I was successful in multitexturing two textures: a base texture which covers an entire polygon and a decal which appears in a small area over the same polygon by using glTexEnv(,,GL_DECAL).
So I thought what happens if I want to put on a base texture and two decals. My video adapter (Geforce MX) has two texture units. So I'll have to do this in two passes.
glClearColor( gray )
enable alpha testing
glAlphaFunc( GL_GREATER, 0.5 )
// Pass number one
glActiveTexture( unit 0 )
glBindTexture( base texture )
glTexEnv(,,GL_DECAL)
enable texturing
glActiveTexture( unit 1 )
glBindTexture( 1st decal )
glTexEnv(,,GL_DECAL)
enable texturing
draw quad
// Pass number two
glActiveTexture( unit 0 )
glBindTexture( 2nd decal )
glTexEnv(,,GL_DECAL)
glActiveTexture( unit 1 )
glBindTexture( 0 ) // unbind texture
disable texturing
draw quad
disable alpha testing
The base texture and 1st decal has been wiped out (all white) and only my 2nd decal appears. What happened?
Inserting glFlush() after pass one did not help.
So I thought what happens if I want to put on a base texture and two decals. My video adapter (Geforce MX) has two texture units. So I'll have to do this in two passes.
glClearColor( gray )
enable alpha testing
glAlphaFunc( GL_GREATER, 0.5 )
// Pass number one
glActiveTexture( unit 0 )
glBindTexture( base texture )
glTexEnv(,,GL_DECAL)
enable texturing
glActiveTexture( unit 1 )
glBindTexture( 1st decal )
glTexEnv(,,GL_DECAL)
enable texturing
draw quad
// Pass number two
glActiveTexture( unit 0 )
glBindTexture( 2nd decal )
glTexEnv(,,GL_DECAL)
glActiveTexture( unit 1 )
glBindTexture( 0 ) // unbind texture
disable texturing
draw quad
disable alpha testing
The base texture and 1st decal has been wiped out (all white) and only my 2nd decal appears. What happened?
Inserting glFlush() after pass one did not help.