Try enabling SAMPLE_ALPHA_TO_COVERAGE - works wonders for alpha masked objects (e.g. billboards) in areas of high depth complexity (without any sorting).
Let’s see a pic of the color channel of your texture. My guess is that you’re using white for the “fill” color. Solution: premultiplied alpha. [/QUOTE]
I dot not know what you mean by fill color, but here is the tga:
But my results were not that good. I will try exporting the tga in a pre-multiplied form, but why is that my little modification in the fragment shader shouldnt do the trick?
read the forsyth article someone’s already linked to - it will answer your questions. You have so obviously not read it. God only helps those who help themselves.
the answer is premultiplied alpha, as dark photon points out.
i think tom forsyth explains it best, as he does most things:- http://home.comcast.net/~tom_forsyth/blog.wiki.html#[[Premultiplied alpha]]]
No really, you should read all of it. An eye opener.
well not really, just multiply your rgb channels by the alpha channel in your image loading code, then change one side of the blend equation with glBlendFunc. 20 minutes, unless you have to type using a stick grasped between your teeth.
Maybe you mean your particle systems?
It is mad though…I certainly didn’t realise the mistake until a couple of years ago when I read Forsyths blog. Is it me though, or does he come across as a real smart arse in that bit? Nobody likes a smart arse. Clever guy though.
Well, here are some photos of the result. This time with a texture changed instead of shader (although I still do not see why it did not work with the shader).
The problem:
I guess that cannot be helped. The only solution I see is by using a order independent transparency shader or by setting alpha to 0 or 255 and not using blending at all, only alpha test.