Original Post
Hi I can't seem to pull off this simple effect using multitexturing and hopefully someone can shed some light here... I have a pair of 2D textures initialized, bound into objects and loaded into 2 multitexture units: TEXTURE0 (RGB, GL_MODULATE) TEXTURE1 (RGBA, GL_DECAL) GL_DECAL cannot be used because it replaces the incoming fragment color which kills the effects of lighting. The effect I am looking for is TEXTURE1 GL_DECALed ONTO TEXTURE0 and then GL_MODULATE against incoming fragment color (which is backward). This would give me the decal effect but preserve the lighting calcs. I did not see a way to do this using glTexEnv and/or glBlendMode. GL_MODULATE and GL_BLEND both multiply which is wrong, GL_REPLACE and GL_DECAL both overwrite the fragment color which is wrong and GL_ADD won't work either. Except for alpha-only textures (like lightmaps), I cannot imagine how you would use a color image beyond texture unit 0 to achieve any desirable effect (color*color=yuck). If I set TEXTURE0 to RGB/GL_MODULATE and draw a quad, then set TEXTURE0 to RGBA/GL_MODULATE and draw the quad again it gives me what I want but it has to process the vertex data twice. Do I have to use 2 render passes with 2 sets of vertex data? Is this not what multitexturing is for? A fragment shader should be able to handle this just fine?