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

Thread: Multitexturing: What happens to layer 3 ?

  1. #1
    Intern Newbie
    Join Date
    Mar 2002
    Location
    Vienna Austria
    Posts
    33

    Multitexturing: What happens to layer 3 ?

    Hi, I'm using
    glActiveTextureARB(GL_TEXTURE0_ARB);
    glEnable(GL_TEXTURE_2D);
    glBindTexture(GL_TEXTURE_2D, texture[stone.tex_index]);

    to perform multitexturing.

    This Lines with GL_TEXTURE0_ARB,GL_TEXTURE1_ARB and GL_TEXTURE2_ARB,

    Whatever OpenGL only renders GL_TEXTURE0_ARB and GL_TEXTURE2_ARB to the screen.

    What happenes to my 2nd layer ?

    info: after using I disable Multitexturing like this:

    glActiveTextureARB(GL_TEXTURE2_ARB);
    glDisable(GL_TEXTURE_2D);
    glActiveTextureARB(GL_TEXTURE1_ARB);
    glDisable(GL_TEXTURE_2D);
    glActiveTextureARB(GL_TEXTURE0_ARB);
    glEnable(GL_TEXTURE_2D);


    Please help,
    Thanks
    StryX
    ***EOF***

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

    Re: Multitexturing: What happens to layer 3 ?

    You probably don't have more than two texture units. Call glGetIntegerv with GL_MAX_TEXTURE_UNITS to see how many units you have.

  3. #3
    Intern Newbie
    Join Date
    Mar 2002
    Location
    Vienna Austria
    Posts
    33

    Re: Multitexturing: What happens to layer 3 ?

    Hm, ok I've only 2 Texture Units.

    But how can I use 3 Layers with 2 Texture Units ??

    Is it possible to have a 3 layered Texture with 2 T.Units ???

    I need, Texture
    Lightmap
    Effect/Detail Map

    How can I put this into 1 texture ??
    ***EOF***

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

    Re: Multitexturing: What happens to layer 3 ?

    If you want to use more than two textures, you will have to buy a new graphics card, or render your object in more than one pass.

  5. #5
    Intern Newbie
    Join Date
    Mar 2002
    Location
    Vienna Austria
    Posts
    33

    Re: Multitexturing: What happens to layer 3 ?

    Multipass, hmm, sounds good.

    Is there any tutorial or something about that ?

    (I'm learning OpenGL for 2 weeks now)

    What about the speed ?
    What would be the frame difference ?

    if (multipass) then fps=fps/2 ???

    Thanks, anyway

    StryX
    ***EOF***

  6. #6
    Member Regular Contributor
    Join Date
    Nov 2000
    Location
    Sydney, NSW, Australia
    Posts
    428

    Re: Multitexturing: What happens to layer 3 ?

    Multipass is slower than single pass since it makes 2 or more passes on the actual geometry, that means you are making twice as many glVertex3f calls and so on. You can speed it up by putting the polygons into display lists or CVA's. It is not 2 times slower since there are other factors that remain unchanged. The geometry calculationg WILL be 2 times slower but the end fps will not be hit as badly as that.
    :: Sleep is a poor substitute for caffeine ::

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

    Re: Multitexturing: What happens to layer 3 ?

    You need to use some sort of blending for the second pass too, otherwise you'd simply overwrite the first pass. To reduce the fill rate overhead, use glDepthFunc(GL_EQUAL); for the second and subsequent passes.

Posting Permissions

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