|
From: Peter <jun...@dp...> - 2010-09-22 22:41:57
|
How as AGG designed to handle the situation where you are blending a partially transparent color with a fully transparent color? I would assume that if it were working with a pixel format that included an alpha channel, it would just overwrite the fully transparent color with the partially transparent, since a fully transparent color would have absolutely zero impact on the final pixel values when blended with anything. But when using AGG, it appears to blend partially transparent colors with fully transparent colors, leading to some very strange results where the pixels that you are drawing are actually blended with a non-existant color! I'm not sure if I'm describing this correctly, so I've attached a patch of lion.cpp example that demonstrates this behaviour that I'm talking about. It sets the background color to green but fully transparent. Normally, you'd expect the RGB channels to have absolutly zero effect when the alpha channel is transparent, but in this example, it somehow blends the lion with the green in the background even though the background is fully transparent, making the lion have a green tint! I'm using AGG 2.5 that I downloaded from http://www.antigrain.com/download/index.html and have also noticed the behaviour from the AGG library included in my distro's repository. The platform is Linux / SDL compiled with GCC 4.2.4. So I guess my question is: Does AGG allow you to renderer stuff over transparent backgrounds? If so, what am I doing wrong? Thanks Peter |