Thread: TGA Alpha Channel

  1. #1
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709

    TGA Alpha Channel

    So I've followed every peice of material I can get my hands on on the subject of alpha channels etc, and none work. I even downloaded and ran the example program from nehe.gamedev that shows simple transparency, and the transparency didn't work. I know my hardware can handle it, so that's not the problem.

    Here's what I have for the init procedure:

    Code:
    bool InitGL ()
    {
            glEnable (GL_TEXTURE_2D);
            glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
            glClearDepth (1.0f);
            glDepthFunc (GL_LEQUAL);
            glEnable (GL_DEPTH_TEST);
    
            glShadeModel (GL_SMOOTH);
            glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
    
            // glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
            // glEnable(GL_BLEND);
    
            glAlphaFunc (GL_GREATER, 0.1f);
            glEnable (GL_ALPHA_TEST);
            
            return true;
    }
    I've commented out glBlendFunc and glEnable there on purpose - If I uncomment those and comment out glAlphaFunc it makes no difference.

    Is there something else I need to do while drawing?
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  2. #2
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    It's alright I figured it out
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 48
    Last Post: 09-26-2008, 03:45 AM
  2. Replies: 23
    Last Post: 07-09-2007, 04:49 AM
  3. Rendering 32-bit images - alpha is ignored
    By ulillillia in forum Windows Programming
    Replies: 59
    Last Post: 04-21-2007, 03:50 PM
  4. 2 questions in DirectX
    By X PaYnE X in forum Game Programming
    Replies: 4
    Last Post: 12-02-2004, 09:38 AM
  5. cprogramming.com IRC channel
    By codec in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 05-06-2004, 10:31 AM