Take the 2-minute tour ×

I am drawing some textures with alpha channel, but when they are displayed it looks like the alpha channel is only binary. So a pixel is either transparent or opaque, although in the texture file itself the pixel is half-transparent. The blending is set up like this:


Is there a workaround for this problem?

The above shows how it should be like, and the below shows how it is:

alt text

share|improve this question
What internalFormat are you using in that texture? –  Matias Valdenegro Sep 3 '10 at 16:07
PNG with transparency –  clamp Sep 4 '10 at 14:39
Can I get more information on the PNG? Like how was it saved? –  Octavian Damiean Sep 6 '10 at 11:24
it was saved with photoshop, and believe me, it has an alpha channel with varying values. it is not binary transparent. –  clamp Sep 6 '10 at 11:28
Would you post a link to the PNG file so I can test it with the same resources? Only if possible. –  Octavian Damiean Sep 6 '10 at 11:54

4 Answers 4

up vote 3 down vote accepted

Try this:


share|improve this answer
Thanks for this. However in my case it is also working without GL_ALPHA_BITS calls –  Vipin Sharma Sep 23 at 10:47

It seems like it's using alpha testing instead of alpha blending, which would explain the thresholding behaviour. Although it isn't enabled by default, it might be worth to try:

share|improve this answer
alpha test is already disabled and i also depth sort all the objects i am painting –  clamp Sep 7 '10 at 9:47

What surface format are you using for your GLSurfaceView? Is it a translucent (not transparent) format?


Also the EGL settings must have alpha support set. This will give you the best of quality...

surfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);

Edit: Another thought is that perhaps you didn't upload the image to OpenGL in a translucent format with glTexImage2D?

share|improve this answer

Are you storing the PNG to a GL texture that only has 1 bit of alpha, such as 16-bit 5-5-5-1 format? This would cause the behavior above.

share|improve this answer

Your Answer


