Results 1 to 4 of 4

Thread: Texture blending help!

  1. #1
    Member Newbie
    Join Date
    Oct 2002
    Atlanta, Ga USA

    Texture blending help!

    Hi all,
    How do you do texture blending? I tried setting GL_BLEND, but than everything turns blue.

    Let me explain what I am trying to do so it can shed some light on the problem. I got some terrain. I render it first pass with 4 texture units using multitexture. All is cool. For my details I had to use GL_LUMINANCE, and GL_COMBINE_ARB to make it come out right, otherwise it turns blue if I try to blend things.

    Now I want to do a second pass on top of the first one, with 4 more textures and blend them into the final result. If i use GL_BLEND, I get blue result. If I enable GL_BLEND and glBlendFunc(GL_ONE, GL_ONE) my fog turns everythign bright white.

    Help please I know I'm not an OpenGL genius here but I'm getting better at it and with your help I'll tame the beast.

    Appreciate it.

  2. #2
    Member Contributor
    Join Date
    Jan 2001

    Re: Texture blending help!

    Have you tried other combinations?

    glBlendFunc (GL_ONE, GL_ZERO);
    glBlendFunc (GL_ZERO, GL_ONE);
    or maybe this would work
    glBlendFunc (GL_ZERO, GL_ZERO);

    cant try this myself at the moment,
    so this combinations might be stupid.

    EDIT: or maybe you hadnt disabled fogging for first pass?

    [This message has been edited by MichaelK (edited 11-07-2002).]

  3. #3
    Member Newbie
    Join Date
    Oct 2002
    Atlanta, Ga USA

    Re: Texture blending help!

    Oh I tried everything, finally got something what I wanted except no matter what I do with fog (turning it on off) it still looks weird.

    I found out that using GL_BLEND in glTexEnv is undefined on 3 or 4 component textures, so that is why I get all blue. It seems it only works with LUMINANCE or INTENSITY textures.


  4. #4
    Senior Member Regular Contributor
    Join Date
    Mar 2002
    California, USA

    Re: Texture blending help!

    Hi, GL_BLEND works for every component texture, 1, 2, 3, or 4. All are calcuated differently. If I were to do what your trying to do, I would use ARB_texture_env_combine to combine the first 4 textures, and the second 4 textures, then blend the 2 together with glBlendFunc. If you dont want to use ARB_texture_env_combine and just use regular texture blending, remember that each successive texture uses the previously applied textures resulting fragment.

    Also, you may not have 4 texture units. What card to you have?

    Old GLman

Similar Threads

  1. texture blending?
    By Andy Gilbert in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 05-06-2010, 08:43 AM
  2. Texture Blending
    By Winegums in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-19-2006, 02:09 AM
  3. Texture Blending
    By Andrew Jameson in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 04-25-2003, 02:12 AM
  4. texture blending
    By zroobavela in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 02-07-2002, 01:17 PM
  5. texture blending
    By dmy in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 01-09-2001, 10:48 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