I was just taking a look at the following tutorial:
But a bit confused at the end. It tries to draw a red rectangle on the top of a blue rectangle with alpha value 0.5;
In the end it calculated the final color (orange) as follows:
New color in framebuffer =
current alpha in framebuffer * current color in framebuffer + (1 - current alpha in framebuffer) * shader’s output color
next it does computation as follows:
new color = 0.5*(0,1,0) + (1-0.5)*(1,0.5,0.5); // (the red was already blended with the white background)
new color = (1, 0.75, 0.25) = the same orange <– confusion here;
Should not the new color be: (0.5, 0.75, 0.25)
Could any one clarify me?
Thank you.