Hello again,
I want to do dot3 bump mapping with ARB_texture_env_combine. So far, that’s no problem. I also got the gloss map working for the specular pass, so now four texture units are in use, the gloss map bound to unit four.
But after the specular pass, I would like to do some blending by destination alpha, but somehow, the alpha value doesn’t make it into the framebuffer, no blending occurs (and it WORKS when drawing a third pass with glColorMask and so only drawing to the alpha component of the framebuffer, the blending works fine, so that’s not the problem for sure). The gloss map texture has an alpha value which would be suitable, but I do not really know how the code should be, at the moment it is
// tu 4: gloss map
glActiveTextureARB(GL_TEXTURE3_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, glossmap);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_TEXTURE);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, GL_PREVIOUS);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_COMBINE_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_TEXTURE);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_ARB, GL_PRIMARY_COLOR_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_ARB, GL_MODULATE);
and I tried several other parameters (due to the lack of a good tutorial it’s more or less trial and error), but nothing seems to work.
any idea? I guess it’s absolutely trivial once you know how to…
Thanks
Jan
[This message has been edited by JanHH (edited 12-25-2003).]
[This message has been edited by JanHH (edited 12-25-2003).]