PDA

View Full Version : multitexturing and "non power of two"



schwede
08-18-2002, 11:52 PM
Is it possible to use multisampling with "non-power-of-two" texture? I have
created a pbuffer which is "non-power-of-two" capable. I have a front buffer
with a texture and a back buffer with an animation. Now I try to map both
textures an the same quad to display this on the desktop. I can display both textures on
sepperate quads on the desktop, but when I try multisampling not much happens. The texture in the back buffer seems to be darker than without multitexturing. But I don't get the desired effect.
Is this possible in general ??

Thanks in advance

Oliver

Robbo
08-18-2002, 11:57 PM
Some code please? Its possible you are modulating with a dark background or something.

schwede
08-19-2002, 12:15 AM
glEnable(GL_TEXTURE_RECTANGLE_NV);//enables rectangle texture support

glEnable(GL_TEXTURE_2D);
glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_2D, frametexture);// animated texture
wglBindTexImageARB(hPbuffer, WGL_BACK_LEFT_ARB);//Pbuffer Texture

glActiveTextureARB(GL_TEXTURE1_ARB);
glBindTexture(GL_TEXTURE_2D, bmptexture);// bmp as texture
wglBindTexImageARB(hPbuffer, WGL_FRONT_LEFT_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);


//draw textured quad with our rendered texture and bitmap
glBegin( GL_QUADS );
glMultiTexCoord2iARB(GL_TEXTURE0_ARB, 0,0);
glMultiTexCoord2iARB(GL_TEXTURE1_ARB, 0,0);
glVertex2f(-1,-1);
glMultiTexCoord2iARB(GL_TEXTURE0_ARB,0,height);
glMultiTexCoord2iARB(GL_TEXTURE1_ARB,0,height);
glVertex2f(-1,1);
glMultiTexCoord2iARB(GL_TEXTURE0_ARB,width,height) ;
glMultiTexCoord2iARB(GL_TEXTURE1_ARB,width,height) ;
glVertex2f(.05,1);
glMultiTexCoord2iARB(GL_TEXTURE0_ARB,width ,0);
glMultiTexCoord2iARB(GL_TEXTURE1_ARB,width ,0);
glVertex2f(.05,-1);
glEnd();
glDisable(GL_TEXTURE_2D);

The "static" texture is just a bmp (I generated alpha values for it) with some geometric, colored stuff.