Results 1 to 3 of 3

Thread: CVA and multitexturing

  1. #1
    Junior Member Newbie
    Join Date
    May 2002
    Posts
    26

    CVA and multitexturing

    Hey guys,

    I am rendering a terrain using cva and multitexturing it. Any ideas why the second texture doesn't seem to show? Thanks in advance

    if (glLockArraysEXT)
    {
    glLockArraysEXT(...);
    }

    glEnableClientState(GL_VERTEX_ARRAY);
    glVertexPointer(3, GL_FLOAT, 0, vertex);

    glEnableClientState(GL_COLOR_ARRAY);
    glColorPointer(3, GL_FLOAT, 0, color);

    glDisableClientState(GL_NORMAL_ARRAY);
    glDisableClientState(GL_INDEX_ARRAY);
    glDisableClientState(GL_EDGE_FLAG_ARRAY);

    glClientActiveTextureARB(GL_TEXTURE0_ARB );
    glEnable(GL_TEXTURE_2D);
    glBindTexture(GL_TEXTURE_2D, texture1);

    glClientActiveTextureARB(GL_TEXTURE1_ARB );
    glEnable(GL_TEXTURE_2D);
    glBindTexture(GL_TEXTURE_2D, texture2);

    glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_CO MBINE_ARB);
    glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_ARB,2);

    glClientActiveTextureARB(GL_TEXTURE0_ARB);
    glTexCoordPointer(2, GL_FLOAT, 0,texCoord1);
    glEnableClientState(GL_TEXTURE_COORD_ARRAY);

    glClientActiveTextureARB(GL_TEXTURE1_ARB);
    glTexCoordPointer(2, GL_FLOAT, 0,texCoord2);
    glEnableClientState(GL_TEXTURE_COORD_ARRAY);

    for (...)
    {
    glDrawElements(...);
    }

    glClientActiveTextureARB(GL_TEXTURE1_ARB);
    glDisable(GL_TEXTURE_2D);

    glClientActiveTextureARB(GL_TEXTURE0_ARB);
    glDisable(GL_TEXTURE_2D);

    if (glUnlockArraysEXT)
    glUnlockArraysEXT();

    [This message has been edited by owcs (edited 06-17-2002).]

    [This message has been edited by owcs (edited 06-17-2002).]

  2. #2
    Super Moderator OpenGL Guru imported_dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    3,966

    Re: CVA and multitexturing

    First try a simple texenv like MODULATE on unit two to test stuff then reenable the combiners. I'm not sure about the defaults but you need to ensure the combiners have the correct operands and operators. You don't seem to set any of this except to scale the result by two.

    You'd want to set your source operands to previous and texture for args 0 and 1 (surely the default) and then choose your operand, try a modulate just as a test.

    For terrain I expect you ultimately want to use all 3 operands and an interpolate operator with arg 2 getting input from primary color, args 0 and 1 remain as above.

    Or something like that.

    [This message has been edited by dorbie (edited 06-18-2002).]

  3. #3
    Junior Member Newbie
    Join Date
    May 2002
    Posts
    26

    Re: CVA and multitexturing

    nope. changing the texenv to GL_MODULATE still didnt help at all. the 2nd texture is still missing. any idea why?

    btw how do you set the source operands,the textures and the operand? i am very new at this and i know very little about combiners. thanks again




    [This message has been edited by owcs (edited 06-18-2002).]

Similar Threads

  1. VBO+multitexturing
    By dletozeun in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 06-19-2006, 02:20 PM
  2. Multitexturing
    By Jeff_Mills in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 10-19-2004, 12:56 PM
  3. arb multitexturing
    By divide in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 12-30-2002, 09:15 AM
  4. Multitexturing
    By tobiaso in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-26-2002, 08:39 AM
  5. Multitexturing
    By Fredy in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-28-2001, 11:13 AM

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