Thread: texture problems with OpenGL

  1. #1
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    New York
    Posts
    1,905

    texture problems with OpenGL

    I am using the following code to enable multi-texturing:

    Code:
    glClientActiveTextureARB(GL_TEXTURE0_ARB);
    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
    glEnableClientState(GL_TEXTURE_ARRAY);
     
    glClientActiveTextureARB(GL_TEXTURE1_ARB);
    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
    glEnableClientState(GL_TEXTURE_ARRAY);
    and this works fine for my engine, with lightmaps and such.

    However, I am trying to render things that AREN'T part of the BSP engine, and don't have lightmaps, but when i try to render them, even though I disable the client states and set the texture back to GL_TEXTURE0_ARB, it renders the textures really screwed up and dotted.........any idea why it does this?

  2. #2
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    I've had the same problem. When you go to draw the text on the screen, or just plain want to disable texture unit 0 or 1, do:

    glActiveTextureARB(GL_TEXTURE0_ARB);
    glDisable(GL_TEXTURE_2D);

    that disables texture unit 0 (your basic texture unit), use GL_TEXTURE1_ARB to disable the second texture unit (your multitexturing or lightmap texture unit)

  3. #3
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    New York
    Posts
    1,905
    ah, i fixed the problem, I had already tried that, but it was still messing up the textures, so i just set the texture to the lightmap textures and set the texture to -1, and that fixed the problem.

  4. #4
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    you did something else wrong then, and I suggest you find that bug, but whatever works for you

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Texture Binding with OpenGL
    By scwizzo in forum Game Programming
    Replies: 5
    Last Post: 07-01-2008, 11:02 AM
  2. Replies: 4
    Last Post: 05-04-2007, 01:09 AM
  3. BMP Loading Questions, More OpenGL!!! :D
    By Shamino in forum Game Programming
    Replies: 13
    Last Post: 05-08-2005, 02:31 PM
  4. Texture mapping in OpenGL
    By Dragon in forum Game Programming
    Replies: 5
    Last Post: 10-19-2003, 09:47 AM
  5. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM