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.
Technically, not even the second texture (tex unit 1) should be drawn, cause GL_DECAL==GL_REPLACE - so it should wipe out the first (tex unit 0) texture… the third decal texture is drawn over the quad as well and then replaces whatever is in the color buffer. Try using GL_MODULATE instead for the second pass and see what happens.
When the alpha channel of a texture is fully opaque, they are the same. Otherwise they are different.
GL_DECAL is blended in with the previous texture unit based on its alpha. GL_REPLACE simply replaces all information from the previous texture unit, including alpha.
The reason you are seeing all white is because the background color of the quad is showing through your decal texture on the second pass. This means that to OpenGL, your quad is not transparent at all.
Setting your mode to GL_REPLACE or GL_MODULATE will fix it.
Thanks for the tip. GL_REPLACE & GL_MODULATE do work for the 3rd decal. OK, so one base texture and two decals works … how 'bout one more decal?
pass1.unit0.replace <-- base texture
pass1.unit1.decal <-- 1st decal
pass2.unit0.replace <-- 2nd decal
pass2.unit1.decal <-- 3rd decal
Didn’t work. 2nd decal OK. Can’t see 3rd decal. Ahhhhhh
I’ve also tried these variations for pass2
unit0.replace = not visible // gets crushed by 3rd decal
unit1.replace = visible
unit0.replace = not visible
unit1.modulate = not visible
unit0.modulate = visible
unit1.decal = not visible
unit0.modulate = not visible
unit1.replace = visible
unit0.modulate = not visible
unit1.modulate = not visible
I think those are all the possible combos. Can you guys help me one more time and I swear I won’t ask for help again … until the next time I need help.