Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: multitexturing and "non power of two"

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2002
    Posts
    4

    multitexturing and "non power of two"

    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

  2. #2
    Member Regular Contributor
    Join Date
    Jul 2001
    Posts
    442

    Re: multitexturing and "non power of two"

    Some code please? Its possible you are modulating with a dark background or something.

  3. #3
    Junior Member Newbie
    Join Date
    Aug 2002
    Posts
    4

    Re: multitexturing and "non power of two"

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •