Results 1 to 7 of 7

Thread: Anyone know any tutorials on multitexturing and blending?

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2004
    Posts
    5

    Anyone know any tutorials on multitexturing and blending?

    Does any know of any links to documentation for multitexturing features of openGL? I’m looking for a way to blend two textures so that it is 75% of one texture and 25% of the other. Can anyone provide me with any tutorials?

  2. #2
    Guest

    Re: Anyone know any tutorials on multitexturing and blending?

    buy a recent version of the redbook and learn it all at once.

    hth

  3. #3
    Guest

    Re: Anyone know any tutorials on multitexturing and blending?

    or read the opengl specifiaction for free.

    hth

  4. #4
    Senior Member OpenGL Pro Zengar's Avatar
    Join Date
    Sep 2001
    Location
    Germany
    Posts
    1,931

    Re: Anyone know any tutorials on multitexturing and blending?

    I would advice you to learn shaders (if you have the hardware, of course). Othervise look into ARB combiners. Nehe tutorials should cover it, I think.

  5. #5
    V-man
    Guest

    Re: Anyone know any tutorials on multitexturing and blending?

    I don't know of any tutorials but I'm sure Nehe has something. To do that kind of blending, it's called interpolation.

    Code :
    glActiveTexture(GL_TEXTURE0);
    glBindTexture(GL_TEXTURE_2D, textureID);
    glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
    glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE);
    glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_REPLACE);
    glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_TEXTURE);
    glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR);
    glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA, GL_TEXTURE);
    glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA);
     
    glActiveTexture(GL_TEXTURE1);
    glBindTexture(GL_TEXTURE_2D, textureID);
    glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
    glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_INTERPOLATE);
    glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_REPLACE);
    glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PREVIOUS);
    glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB, GL_TEXTURE);
    glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB, GL_CONSTANT);
    glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR);
    glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR);
    glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB, GL_SRC_COLOR);
    glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA, GL_TEXTURE);
    glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA);
     
    float mycolor[]={0.75, 0.75, 0.75, 0.75};
    glTexEnfv(GL_TEXTURE_ENV, ..., mycolor);

  6. #6
    Junior Member Newbie
    Join Date
    Sep 2004
    Posts
    5

    Re: Anyone know any tutorials on multitexturing and blending?

    Usually the demos that I download that use pixel shaders are extremely slow so I don't think I have hardware support for that. Even if I did though, I still wouldn’t want to use them because there would be a large number people that wouldn’t be able to use my program and I’d want to market it to as many people as possible.

    I’ve been going over the specs if it mentions anything about what I’m trying to do then it went right over my head. Could somebody at least tell me if it is possible to do without using shaders?

  7. #7
    Junior Member Newbie
    Join Date
    Sep 2004
    Posts
    5

    Re: Anyone know any tutorials on multitexturing and blending?

    Thanks V-man, I just ranked you up on gamedev.

Similar Threads

  1. Blending and Multitexturing
    By Andre Gro in forum OpenGL: Advanced Coding
    Replies: 12
    Last Post: 06-03-2004, 11:32 PM
  2. Blending and multitexturing.
    By timmie in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 08-14-2003, 03:07 PM
  3. Blending or Multitexturing?
    By jpummill in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 06-24-2003, 06:33 PM
  4. multitexturing tutorials.
    By IceDagger in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 11-02-2002, 01:28 AM
  5. Multitexturing tutorials
    By Kranomano in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-04-2001, 04:07 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