Jump to content
  • Advertisement
Sign in to follow this  

Alpha Blending in Android GLES

This topic is 2955 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm currently working on an android project and I've been trying to render some basic bitmap-text on screen and ran into a few problems. I was using a simple linear filter on the texture when rendering and storing the glyph data of the font in the alpha channel in a standard png image file (without any anti-aliasing, simply 1 or 0 for alpha). When I was rendering this I noticed that the text was extremely faded in some areas and in other areas it was pure white. After rendering the font sheet with alpha blending disabled I noticed that I could still see the glyphs even though the RGB components of each pixel were set to white. The reason the text was fragmented in areas is because it was sampling black pixels via the linear filter and therefore making the resulting alpha value extremely low.

Is this supposed to happen? I have made sure that alpha blending is disabled (gl.glDisable(GL10.GL_BLEND)) and yet when I render a texture it treats the alpha channel as a scaling factor?

I got around this by copying the input Bitmap and just using its alpha channel i.e. (Bitmap.copy(Bitmap.Config.ALPHA_8, true)) but I was still curious as to why this was happening?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!