05-06-2017, 05:35 PM
Hello,
I have a doubt on how the alpha blending algorithm works. Basically, I want to draw a black screen, and then I want to draw pixels so that the first time I draw a given pixel, it's just barely visible, then after drawing over it more and more, it gets more and more white.
But I noticed that if I do for example:
PIXON_P(X,Y,#F0FFFFFFh)
(which is a pure white pixel with an alpha channel of #F0h), I don't get what I expect. What I get is that after very few "overlaps" (around 10) the pixel stops getting brighter, and stays at a rather dark grey. If I modify the alpha value, to i.e. #F5h, the pixels still saturate after about 10 overlaps, but to a very dark grey instead.
I was expecting that, since I'm drawing a partially transparent pure white pixel, the "saturated" color would be pure white, and that it would take more or less overlaps to get there depending on the transparency level...
What am I doing wrong? How can I get the result I need? Ideally, I'd like to have the pixels get a (1,1,1) color after the first drawing, and get to (255,255,255) after n overlaps, with n variable but ideally 255...
Thank you,
Cristian
I have a doubt on how the alpha blending algorithm works. Basically, I want to draw a black screen, and then I want to draw pixels so that the first time I draw a given pixel, it's just barely visible, then after drawing over it more and more, it gets more and more white.
But I noticed that if I do for example:
PIXON_P(X,Y,#F0FFFFFFh)
(which is a pure white pixel with an alpha channel of #F0h), I don't get what I expect. What I get is that after very few "overlaps" (around 10) the pixel stops getting brighter, and stays at a rather dark grey. If I modify the alpha value, to i.e. #F5h, the pixels still saturate after about 10 overlaps, but to a very dark grey instead.
I was expecting that, since I'm drawing a partially transparent pure white pixel, the "saturated" color would be pure white, and that it would take more or less overlaps to get there depending on the transparency level...
What am I doing wrong? How can I get the result I need? Ideally, I'd like to have the pixels get a (1,1,1) color after the first drawing, and get to (255,255,255) after n overlaps, with n variable but ideally 255...
Thank you,
Cristian