I’m trying to draw masked sprites with antialias. For example, let say I have a texture which is letter A, it has two colors, white for the solid pixels (alpha=1.0), and magenta for the background (alpha=0.0), then I render this texture as a 2D texture quad using GL_LINEAR as filters (for antialias), and I use the Alpha Test to skip background pixels, the problem is that the antialiased parts is a mix of white and magenta scaled colors… how can I render this sprite (texture) with both masking and antialias ??, the antialias I want it to be mixed with the scene background not with the sprite’s mask color…
It’s very simple actually. When you load an image from disk you process it to add alpha channel right? Simply fill your texture with white color during that process so there are no more magenta pixels. Only white+alpha=1.0 and white+alpha=0.0
There is no other way.
There is one and I’m using it - I paint images with alpha channel and save to PNG (it supports alpha cannels). I do all necessary color bleeding in Paint Shop Pro - my application just loads these images and oesn’t have to do anything with it - just display.