ok, it’s possible!
i just finished the test, i’ll email you the exe in a few seconds.
here i post the meaningful code:
glBlendFunc(BLEND_ALPHA);
glEnable(GL_BLEND);
glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
alpha.use(); // glBindTexture(…)
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
image.use(); // glBindTexture(…)
then you draw the primitives by setting the texture coordinates of eevery TU:
glColor3f(1,1,1);
glBegin(GL_QUADS);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB,0,0);
glMultiTexCoord2fARB(GL_TEXTURE1_ARB,0,0);
glVertex2f(-1,-1);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB,1,0);
glMultiTexCoord2fARB(GL_TEXTURE1_ARB,1,0);
glVertex2f(+1,-1);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB,1,1);
glMultiTexCoord2fARB(GL_TEXTURE1_ARB,1,1);
glVertex2f(+1,+1);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB,0,1);
glMultiTexCoord2fARB(GL_TEXTURE1_ARB,0,1);
glVertex2f(-1,+1);
glEnd();
it was not the way i first thought: you set the first TU to be processed (TU 0) as the alpha map.
the second TU (TU 1) then gets the alpha values from the first TU.
if i thougt better before, i would found why:
the current color fragment is made of r,g,b AND alpha values.
in modulate mode, the fragments are multiplied in cascade, so:
texture.r=tu0.rtu1.r
texture.g=tu0.gtu1.g
texture.b=tu0.btu1.b
texture.a=tu0.atu1.a
the TU0 has RGB=glColor (set to 1,1,1) and alpha channel wich varies from 0 to 1.
the TU1 instead has fixed alpha=1 and RGB is variable.
so from the calcs you get the final texture made out of TU0[alpha] and TU1[RGB].
hey, good looking indeed
Dolo//\ightY
PS: oops… just saw you have no email.
post or edit your address and i’ll send.
[This message has been edited by dmy (edited 05-19-2000).]