Question

I've problem with texture rendering on OpenGL 1.1 with a linear filter : it's rendering some artifacts on "0" and "8" like that :

Artifacts font rendering download it for zooming

it adds a kind of shadow on the first column of pixels.

I tried all the GL_TEXTURE_WRAP_S/GL_TEXTURE_WRAP_T values with no success. The Nearest filter doesn't show artifacts : but it's ugly (I don't want to use this filter)

The font texture seems ok (I just copied the intersting part and add a background color for understanding) : Font texture

You can download it here with the transparent background (#00000000)

The blending seems ok too : glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

Was it helpful?

Solution

The solution is to use pre-multiply alpha. Basically, you need to pre-multiply your RGB by your alpha in your texture. And use glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);

Here's a great video that explain your problem:

http://www.youtube.com/watch?v=dU9AXzCabiM

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top