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

Thread: How to use Combined Texture?

  1. #1
    Intern Contributor
    Join Date
    May 2006
    Posts
    56

    How to use Combined Texture?

    Usually, we draw a triangle with texture like this:
    Code :
           glBindTexture(GL_TEXTURE_2D,texturename);
           glEnable(GL_TEXTURE_2D);
           glBegin(GL_TRIANGLES);
             glTexCoord2f(0.0, 0.0);
             glVertex3f(0.0, 0.0, 0.0);
             ...
           glEnd();
    And when we use Combined Texture which have two units:
    Code :
          glActiveTexture(GL_TEXTURE0);
          glBindTexture(GL_TEXTURE_2D, texname0);
          ...
          glActiveTexture(GL_TEXUTRE1);
          glBindTexture(GL_TEXUTRE_2D, texname1);
          ...
    The problem is how could we tell the triangle to use the combined texture?
    glBindTexture()

  2. #2
    Member Regular Contributor CrazyButcher's Avatar
    Join Date
    Jan 2004
    Location
    Germany
    Posts
    402

    Re: How to use Combined Texture?

    could you elobarate more on the question. cause apparently you already presented the code on "how to use more than one texture" ?

    if you mean the way the textures are combined (color/alpha wise)
    look into glTexEnv for some basic combiners, or the ARB_texture_env_combine extension for more complex combining

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Aug 2004
    Location
    munich, germany
    Posts
    664

    Re: How to use Combined Texture?

    don't forget that you have to call glEnable(GL_TEXTURE_2D) for each texture unit after choosing glActiveTexture().

  4. #4
    Intern Contributor
    Join Date
    May 2006
    Posts
    56

    Re: How to use Combined Texture?

    Use 3D texture to rendering a volume and use 1D texture to control the 3D texture's alpha value.
    That is I want to do.

    Usually, we use multitexture with glMultiTexCoord.But this time we can't. I have to creat only one TextureCoordinate array for 3D texture. I can't create texCoord for 1D Texture.Because it need more and more vertices.That is the problem.So Could I use Texture Combiner to deal with it?

  5. #5
    Senior Member OpenGL Pro k_szczech's Avatar
    Join Date
    Feb 2006
    Location
    Poland
    Posts
    1,119

    Re: How to use Combined Texture?

    I can't create texCoord for 1D Texture.Because it need more and more vertices.
    I don't quite understand it - do you want to use color fetched from 3D texture as coordinate for 1D texture? If yes, then you should use shader.
    As long as you do not describe what functionality are you trying to implement we will probably not be able to help.

  6. #6
    Intern Contributor
    Join Date
    May 2006
    Posts
    56

    Re: How to use Combined Texture?

    I want to change the Volume Alpha value in real time mode.But create 3D texture need much more time.So I want to find a way to deal these.

    First I want to use glColorTableEXT, but my graphic card do not support it.

    then I want to use texture combiner to combine 3D texture and 1D texture, and change the 1D texture in real-time mode.But it does not seem correct So I find help here.

    Shader can do these?

Posting Permissions

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