I could use some help… I have searched this site and others employin what I have to try and get this to work and I am getting really discouraged at this point…
I have a sphere I have been trying to test out different texturing techniques with.
Currently I am trying to use multitexturing. I would like to place two textures on my model.
The first has an all white alpha channel and acts as the base texture of the object.
The second image has black dots on its alpha to let the base show through.
So when I try all of the stuff below all I get is the last texture drawn. Where the Alpha is 0 I can see through to the backfaces,
no sign of the base texture. Where the alpha is 1, I can see the color of the decal map drawn translucently with the backfaes showing through.
I have a GeForce 2MX…OsX Jaguar.4
I am using tiffs…
Create Textures---->>
glGenTextures(1, &texture[0]);
glBindTexture(GL_TEXTURE_2D, texture[0]);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, 4, image0->width, image0->height, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, image0->raster);
glGenTextures(1, &texture[1]);
glBindTexture(GL_TEXTURE_2D, texture[1]);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, 4, image0->width, image0->height, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, image0->raster);
GLinit------>>
glClearColor(0.0, 0.0, 0.0, 1.0);
glShadeModel(GL_SMOOTH);
glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glDepthMask(GL_TRUE);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
LightInit---->>
//all these guys alpha values are 1//
glLightfv(GL_LIGHT1, GL_AMBIENT, LightAmbient); // add lighting. (ambient)
glLightfv(GL_LIGHT1, GL_DIFFUSE, LightDiffuse); // add lighting. (diffuse).
glLightfv(GL_LIGHT1, GL_POSITION,LightPosition); // set light position.
glEnable(GL_LIGHT1); // turn light 1 on.
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE,GL_FALSE);
DrawRoutine----->>>
glDisable(GL_DEPTH_TEST);
glPolygonMode(GL_FRONT, GL_FILL);
glPolygonMode(GL_BACK, GL_LINE);//I enable this to see whats going..
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_2D, texture[0]);
glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_REPLACE);
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_ALPHA_TEST);
glBindTexture(GL_TEXTURE_2D, texture[1]);
glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_DECAL);
model->draw();
//in the model's draw routine I pass texture coordinates like this: //glMultiTexCoord2fARB(GL_TEXTURE0_ARB, vt_array[(vtIndex[k])][0],vt_array[(vtIndex[k])][1]);
//glMultiTexCoord2fARB(GL_TEXTURE1_ARB, vt_array[(vtIndex[k])][0],vt_array[(vtIndex[k])][1]);