mIc
03-07-2006, 07:58 AM
Hi,
I'm trying to get multitexturing done using the ARB_multitexture extension, but something went wrong.
In the first version of my program, I did not use multitexturing and created a display list for a sphere with a texture of earth. Texture relevant calls have been:
glBindTexture( GL_TEXTURE_2D, texture[0] );
and between glBegin / glEnd:
glTexCoord2f( s, t );
That worked fine.
Now instead of using glBindTexture, I'm using code that makes use of the multitexture extension:
glActiveTextureARB( GL_TEXTURE0_ARB );
glEnable( GL_TEXTURE_2D );
glBindTexture( GL_TEXTURE_2D, texture[0] );
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
and between glBegin / glEnd:
glMultiTexCoord2fARB( GL_TEXTURE0_ARB, s, t);
Now instead of a nice earth I do have some blue globe (maybe a small part of the texture, a very small part in this case).
What am I doing wrong?
EDIT: digging deeper into the forums, i found out that i had to disable the other texture units. But there's still a graphical glitch, on one quarter of my sphere I have streaks which i cannot explain.
Here's the render of the image with multitexture:
http://img340.imageshack.us/img340/394/multitexture9po.jpg
Here's the render of the image without multitexture:
http://img52.imageshack.us/img52/7105/normal0ct.jpg
Anyone knows what i'm doing wrong?
I'm trying to get multitexturing done using the ARB_multitexture extension, but something went wrong.
In the first version of my program, I did not use multitexturing and created a display list for a sphere with a texture of earth. Texture relevant calls have been:
glBindTexture( GL_TEXTURE_2D, texture[0] );
and between glBegin / glEnd:
glTexCoord2f( s, t );
That worked fine.
Now instead of using glBindTexture, I'm using code that makes use of the multitexture extension:
glActiveTextureARB( GL_TEXTURE0_ARB );
glEnable( GL_TEXTURE_2D );
glBindTexture( GL_TEXTURE_2D, texture[0] );
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
and between glBegin / glEnd:
glMultiTexCoord2fARB( GL_TEXTURE0_ARB, s, t);
Now instead of a nice earth I do have some blue globe (maybe a small part of the texture, a very small part in this case).
What am I doing wrong?
EDIT: digging deeper into the forums, i found out that i had to disable the other texture units. But there's still a graphical glitch, on one quarter of my sphere I have streaks which i cannot explain.
Here's the render of the image with multitexture:
http://img340.imageshack.us/img340/394/multitexture9po.jpg
Here's the render of the image without multitexture:
http://img52.imageshack.us/img52/7105/normal0ct.jpg
Anyone knows what i'm doing wrong?