Can't get alpha blended textures to behave properly...

Discussion in 'iOS Programming' started by cwolves, Apr 20, 2009.

  1. macrumors regular

    Joined:
    Oct 11, 2007
    #1
    I can't for the life of me get two png textures to render on top of one-another properly when the top one has partial transparency.

    [​IMG]

    The above image shows three renders. One using polygons (a blue square with a white diamond and 50% opacity on top of it, blending mode: glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA))

    And two with textures. One using the "normal" rendering mode, the other using the "premultiplied" rendering mode, at least according to forums...

    All I want is to reproduce the first result using textures....


    Oh, and I've LITERALLY tried every blending mode possible with glBlendFunc.
     
  2. macrumors 6502a

    Joined:
    Sep 3, 2005
    Location:
    Cramlington, UK
    #2
    Stupid question, but have you enabled blending?

    Code:
    glEnable( GL_BLEND ) ;
    
    Oh and also what texture mode are you using? I use white polygons with the modulate mode:-

    Code:
    glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ) ;
    
    b e n
     

Share This Page