Results 1 to 3 of 3

Thread: OpenGL ES Texture Transparency

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2011
    Location
    Florida
    Posts
    5

    OpenGL ES Texture Transparency

    I'm working on learning OpenGL ES to expand my iPhone development capabilities, but I'm running into some problems with transparent textures that I can't seem to figure out through Google.

    Here are some pics:
    http://www.fullofepicwin.com/randomFiles/IMG_0785.PNG
    http://www.fullofepicwin.com/randomFiles/IMG_0786.PNG

    I'm using this blend function:
    glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);

    The object in the front seems to work exactly the way I want, but the other three objects are acting much differently.

    As you can see, the transparency of the small circle only seems to work when it is over the small D-Pad square, of which no transparency can be seen. This seems really strange as all objects are creating in exactly the same way, but are being displayed differently.

    Thanks in advance for your help, I could surely use it
    Platform: iOS
    API: OpenGL ES 1.1
    OpenGL Experience: Total n00b
    <www.patrickcossette.com>

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Mar 2009
    Location
    Karachi, Pakistan
    Posts
    810

    Re: OpenGL ES Texture Transparency

    Hi,
    Try the basic belnd eq. but also make sure that u render them in back to front order.
    Code :
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    Regards,
    Mobeen

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2011
    Location
    Florida
    Posts
    5

    Re: OpenGL ES Texture Transparency

    That certainly did fix the problem, the strange behavior was indeed due to the order in which I drew my objects, thanks a lot for the help! This also helps me to understand how transparency actually works, by taking each transparent pixel and using the selected blend function to mix it with whatever is in the buffer at that moment.

    Thanks again! You'll probably be seeing a lot of posts from me in the future, I promise to return the favor once I know what I'm doing :P
    Platform: iOS
    API: OpenGL ES 1.1
    OpenGL Experience: Total n00b
    <www.patrickcossette.com>

Similar Threads

  1. [OpenGL 1.X] Drawing 2D Texture with custom Transparency
    By XamlDdev in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 07-17-2013, 10:51 AM
  2. Texture Transparency .BMP
    By Darius in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 12-12-2012, 07:18 PM
  3. Transparency using texture
    By Sarah Clough in forum OpenGL: Windows
    Replies: 4
    Last Post: 05-15-2007, 07:24 AM
  4. Transparency in a texture
    By werdy666 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 07-02-2002, 07:18 PM
  5. OpenGL window transparency and texture transparency
    By ramalhais in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 03-15-2002, 09:37 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