Sprite is not fully transparent

Started by
1 comment, last by pescador 14 years, 5 months ago
Hi developers! Well, I made some pictures in PNG format to make some parts of the sprites transparent. But I can't understand why it's not fully transparent (I still can see the "transparent" area). See the blue ball: http://i33.tinypic.com/2ev6wjq.jpg

//init function

    glDepthMask(GL_FALSE);
    glDisable(GL_DEPTH_TEST);
    glDisable(GL_CULL_FACE);
    glDisable(GL_DITHER);
    glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);

//render function

    glEnable(GL_TEXTURE_2D);

    glPushMatrix();
    glTranslatef(-0.5, 0, 0);
    glScalef(0.3, 0.3, 0);
    glRotatef(angle, 0, 0, 1);
    glCallList(dlist1);
    glPopMatrix();

    //blue ball
    glPushMatrix();
    glTranslatef(0.5, 0, 0);
    glScalef(0.3, 0.3, 0);
    glRotatef(angle, 0, 0, 1);
    glEnable(GL_BLEND);
    glCallList(dlist2);
    glDisable(GL_BLEND);
    glPopMatrix();

    glDisable(GL_TEXTURE_2D);
Advertisement
Try using glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
Well... one more time, thankyou. Now It works!

This topic is closed to new replies.

Advertisement