WebGl Transparency and Alpha Blending problem

A few days ago I ran into a problem with fonts transprency and alpha blending in WebGL. To see what I’m talking about let me show you a picture with my fonts problem:

(Click on the picture to zoom in)

You can see that, letters have white pixels in margins, which ruins the font :(. My fonts are exported from FreeType and I generate anti-aliased images for webgl textures . This mean that alpha channel will have different values between 0 and 255.

I discovered that webgl is composited with the html page and use pre-multiplied alpha by default. This means that for a RGB color like 1,0,1 with alpha 0.5 you will get something like 0.5 ,0 , 0.5. This might help you or not, depends on what result you want.

I have been working as a software engineer in computer graphics for almost 5 years. In the free time I love playing guitar, playing video games, hiking and studying computer graphics techniques.Follow me on : Google + , Twitter, Facebook