Results 1 to 4 of 4

Thread: Transparent Textures

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2001
    Posts
    3

    Transparent Textures

    Hello all,

    In my code I am loading textures from file in RGBA format. Now I was wondering how I could use the A element to set the transparency of the texel. I have tried using GL_Blend in glTexEnvf, but the image looks all screwed up then( I think it's being inverted ), though any of the other functions works fine( but doesn't do transparency ). How should I get this to work properly?

    Thsnks,

    Reb Crush

  2. #2
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Nov 2010
    Posts
    2,466

    Re: Transparent Textures

    glBlendFunc( GL_SRC_ALPGA,GL_ONE_MINUS_SRC_ALPHA)
    will blending the texture with the frame buffer depending on the textures pixels alpha value. ie 1 for totally replace the colour in the framebuffer and 0 for leave it the same. between 0-1 for a mix of the 2

  3. #3
    Senior Member Regular Contributor
    Join Date
    Jul 2000
    Location
    Arlon, Belgium
    Posts
    477

    Re: Transparent Textures

    Hi,

    On my site : http://ibelgique.ifrance.com/Slug-Production

    "Download" section, I've a little example who display a tree using the alpha chanel.

  4. #4
    Junior Member Newbie
    Join Date
    Jun 2001
    Posts
    3

    Re: Transparent Textures

    Somehow it does work now with GL_REPLACE.... Hmmmm, strange.

    Well, C does that more often =)

    Anyway, thanks!

Similar Threads

  1. Opengl 1.1 and transparent textures
    By Devdept2 in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 12-29-2010, 08:31 AM
  2. Transparent textures
    By fatquack in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-13-2008, 08:43 AM
  3. Transparent Textures
    By in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 02-04-2005, 08:06 AM
  4. Transparent Textures
    By Azazel in forum OpenGL: Basic Coding
    Replies: 14
    Last Post: 01-16-2004, 12:23 AM
  5. Transparent Textures
    By mike_p in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-18-2002, 06:35 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