PDA

View Full Version : problems with texture_env_combine



Lars
07-25-2002, 07:02 AM
Hi
i am trying to use the texture_env_combine extension, but it does'nt seem to work.
I use this code for rendering:




// Enable combining
glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_CO MBINE_ARB );
// just selecting primary color
glTexEnvi(GL_TEXTURE_ENV,GL_SOURCE0_RGB_ARB,GL_PRI MARY_COLOR_ARB );
glTexEnvi(GL_TEXTURE_ENV,GL_OPERAND0_RGB_ARB,GL_SR C_COLOR);
// no scaling
glTexEnvi(GL_TEXTURE_ENV,GL_RGB_SCALE_ARB,1);
// set combine operation replace
glTexEnvi(GL_TEXTURE_ENV,GL_COMBINE_RGB_ARB,GL_REP LACE);
// switching to second texture unit
glClientActiveTextureARB(GL_TEXTURE1_ARB);
// set everything to keep the result of the previous unit
glTexEnvi(GL_TEXTURE_ENV,GL_SOURCE0_RGB_ARB,GL_PRE VIOUS_ARB );
glTexEnvi(GL_TEXTURE_ENV,GL_OPERAND0_RGB_ARB,GL_SR C_COLOR);
glTexEnvi(GL_TEXTURE_ENV,GL_RGB_SCALE_ARB,1);
glTexEnvi(GL_TEXTURE_ENV,GL_COMBINE_RGB_ARB,GL_REP LACE);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
// rendering
glDrawElements(GL_TRIANGLES, mesh->indexAnzahl, GL_UNSIGNED_SHORT, mesh->indices);


This should disable texturing, but i still get an textured model. Is there any other state i have to set ?
(I do this for testing, i know i can just disable texturing by setting glDisable(GL_TEXTURE_2D) but i need to get the combiners working)

thanks

Lars

Bob
07-25-2002, 10:22 AM
Set new texture unit with glActiveTexture instead of glClientActiveTexture.

Lars
07-25-2002, 04:59 PM
Thanks it solved the problem and a second one by looking thru all the places where i used activeTexture.

Lars

[This message has been edited by Lars (edited 07-25-2002).]