Problem with MultiTexturing! :(

ok,my app keeps crashing when I try to do this:

glBegin(GL_POLYGON);
//The first triangle
glMultiTexCoord2f(GL_TEXTURE0_ARB,0.0f,1.0f);
glMultiTexCoord2f(GL_TEXTURE1_ARB,0.0f,1.0f);
glVertex3f( -1.0f, 1.0f, 0.0f);// Top

  glMultiTexCoord2f(GL_TEXTURE0_ARB,0.0f,0.0f);
  glMultiTexCoord2f(GL_TEXTURE1_ARB,0.0f,0.0f);
  glVertex3f( -1.0f, -1.0f, 0.0f);// Bottom Left
  
  glMultiTexCoord2f(GL_TEXTURE0_ARB,1.0f,0.0f);
  glMultiTexCoord2f(GL_TEXTURE1_ARB,1.0f,0.0f);
  glVertex3f( 1.0f, -1.0f, 0.0f);// Bottom Right

glEnd();

Any idea why? When I created the multitextures I did this:

glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_2D, texture[0]);
glEnable(GL_TEXTURE_2D);

glActiveTextureARB(GL_TEXTURE1_ARB);
glBindTexture(GL_TEXTURE_2D, texture[1]);
glEnable(GL_TEXTURE_2D);

Once again,any help would be much appreciated

And,yes,I did glEnable(GL_TEXTURE_2D);

Dunno, it should work, but hell, OpenGL is sometimes as quirky as MS software is.

Try this:

Before you make your call to glMultiTextureCoord* insert a call to glActiveTexture setting the correct TMU in action. I do that with my vertex arrays (kinda because I’m not using glMultiTextureCoord), but it might cause the system to respond appropriately.

I think that the way they designed the multitex support on some systems isn’t the standard “expected” way it should be implemented.

Let me know if it works.

Siwko

Right, looks quite ok.
Maybe that’s too simple, but have you checked the contents of the function pointers you got with wglGetProcAddres?

Oh YES! Got it working! The problem was as you said with the function pointers.I had this call:

glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FARBPROC)wglGetProcAddress(“glMultiTexCoord2f”);

instead of this:

glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FARBPROC)wglGetProcAddress(“glMultiTexCoord2fARB”);

I feel really stupid right now.

Anyway,I finally rendered my image but it appears darker than what I expected.Is that suppose to happen? How can I make it brighter? (Without lights!)
And is there any way to play with the opacity of the other textures? Thanx again guys!

[This message has been edited by TheGecko (edited 08-04-2000).]

Maybe got got some odd blendfunction…

Try play around with different blendfunctions and see what happens. glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) works great for me.

Also, you should try gamma correction, using *_gamma_control extensions, or ICM for windows ( Get/SetDeviceGammaRamp )