Results 1 to 6 of 6

Thread: VA + Multitexture Question

  1. #1
    Senior Member Regular Contributor
    Join Date
    Mar 2002
    Location
    California, USA
    Posts
    167

    VA + Multitexture Question

    Hello,

    I am having some trouble setting up multitexturing with my indexed vertex array. I found some previous posts on the board but the only one that was of any use I do not really understand. Can someone explain the procedure of setting it up? The example I found had two different arrays of texture coordinates. If my primitives are going to have the same texture coordinates for each texture, can I just set up all my textures for just one texture coordinate array? Thanks for your help.

    Old GLman

  2. #2
    Senior Member Regular Contributor
    Join Date
    Sep 2001
    Location
    Eastern USA
    Posts
    218

    Re: VA + Multitexture Question

    This confused me at first. I haven't done it yet, but the way I understand it (and please do correct me if I'm wrong)

    you call glActiveTextureARB(...) (or whatever you use) to set your active texture unit, then you do glTexCoordPointer(...) as required.

    Then, call glActiveTextureARB(...) to switch to the "next" texture unit, and call glTexCoordPointer(...) again, with the set of coordinates for the new texture level.

    Lather, rinse, repeat as desired.

  3. #3
    Senior Member Regular Contributor
    Join Date
    Mar 2002
    Location
    California, USA
    Posts
    167

    Re: VA + Multitexture Question

    Hi,

    Thanks for your reply. If this is the case, and someone please point out if we are wrong, can I just have each texture unit point to the same array of texture coords? In my app there is no reason to have another set of texture coordinates when each set would be exactly the same.

    EDIT:

    Hi,

    I did some more digging. This article explains it pretty good. Also, you can have separate texture units pointing to the same texture coordinate array. Till next time!

    Old GLman

    [This message has been edited by Old GLman (edited 04-23-2002).]

  4. #4
    Senior Member Regular Contributor
    Join Date
    Sep 2001
    Location
    Eastern USA
    Posts
    218

    Re: VA + Multitexture Question

    I imagine so.

    /me shields face from imminent counter-argument

  5. #5
    Senior Member Regular Contributor
    Join Date
    Jul 2001
    Posts
    442

    Re: VA + Multitexture Question

    Yes - you can use the same set of texture coords for both texture units.

  6. #6
    Member Contributor nemesis's Avatar
    Join Date
    Nov 2001
    Posts
    80

    Re: VA + Multitexture Question

    Hello!

    Yes, you can certainly use the same cordinates array.
    For example, you can do something like this:

    // Define the arrays
    glVertexPointer(3, GL_FLOAT, sizeof(Vector), vertexArray);

    glClientActiveTextureARB(GL_TEXTURE0_ARB);
    glTexCoordPointer (2, GL_FLOAT, sizeof(TexCoord), texCoordsArray);

    glClientActiveTextureARB(GL_TEXTURE1_ARB);
    glTexCoordPointer (2, GL_FLOAT, sizeof(TexCoord), texCoordsArray);

    // Activate the textures
    glActiveTextureARB ( GL_TEXTURE0_ARB );
    glBindTexture(GL_TEXTURE_2D,glTextureID[i]);

    glActiveTextureARB ( GL_TEXTURE1_ARB );
    glBindTexture(GL_TEXTURE_2D,glTextureID[j]);

    // DRAW...

    -nemesis-

    [This message has been edited by nemesis (edited 04-25-2002).]

Similar Threads

  1. multitexture
    By kewuwsi in forum OpenGL: GLSL
    Replies: 4
    Last Post: 04-17-2007, 11:16 AM
  2. About MultiTexture .
    By Benjamin in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 10-11-2005, 03:08 AM
  3. multitexture
    By davidib in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 02-11-2005, 01:46 PM
  4. Multitexture Question
    By azcoder in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 05-03-2004, 08:51 AM
  5. multitexture blending question
    By soconne in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 10-12-2003, 10:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean