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 4 of 4

Thread: disable multitexture/uvs when done?

  1. #1
    Junior Member Regular Contributor
    Join Date
    Feb 2004
    Location
    Aus
    Posts
    148

    disable multitexture/uvs when done?

    okay i am using vbo's with 2 sets of uv's and 2 textures to render my scene with a lightmap.

    this is currently how i disable them:

    glClientActiveTexture( GL_TEXTURE0_ARB );
    glBindBufferARB( GL_ARRAY_BUFFER_ARB, 0 );
    glDisableClientState( GL_TEXTURE_COORD_ARRAY );


    glClientActiveTexture( GL_TEXTURE1_ARB );
    glBindBufferARB( GL_ARRAY_BUFFER_ARB, 0 );
    glDisableClientState( GL_TEXTURE_COORD_ARRAY );

    now, this doesnt work properly, as my other models that dont use vbos and multitexturing such as my font system and skybox are rendered really dark, and flicker like some multitexturing is still happening?

    ideas? thanks...

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    3,115

    Re: disable multitexture/uvs when done?

    Do you disable texturing for all units aswell?

    edit: Should read the question better next time. Texture bindings are not a clinet state, it's a server state, so you need to change texture unit with glActiveTexture. And use glDisable instead of binding ID 0.

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Feb 2002
    Location
    Bonn, Germany
    Posts
    1,652

    Re: disable multitexture/uvs when done?

    Yup. Disable texcoords and texturing.
    Code :
    glClientActiveTexture( GL_TEXTURE0_ARB );
    glDisableClientState( GL_TEXTURE_COORD_ARRAY );
    glActiveTexture(GL_TEXTURE0_ARB);
    glDisable(GL_TEXTURE_2D);  //or _1D, _3D, _RECTANGLE_EXT, whatever
     
    glClientActiveTexture( GL_TEXTURE1_ARB );
    glDisableClientState( GL_TEXTURE_COORD_ARRAY );
    glActiveTexture(GL_TEXTURE1_ARB);
    glDisable(GL_TEXTURE_2D);
     
    //optional paranoia
    glClientActiveTexture(GL_TEXTURE0_ARB);
    glActiveTexture(GL_TEXTURE0_ARB);

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,704

    Re: disable multitexture/uvs when done?

    Do you set the active texture back to TEXTURE0 before setting up other texturing?

    Also, you don't need to separately BindBuffer(). The bound buffer is only actually inspected by the GL when you call VertexPointer, TexCoordPointer, etc.
    "If you can't afford to do something right,
    you'd better make sure you can afford to do it wrong!"

Posting Permissions

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