Hi, I'm curious as to how transparency works internally. Specifically, I'd like to know about the math. I've been trying to implement transparency in Game Maker by hand, but it's not working properly. It's really basic, for now I'm just trying to calculate the intersection color of two overlapping rectangles, while also having "real" rectangles for reference. I did find some formulas, but I wasn't sure about how to implement them, so I figured out my own and applied to each channel:
R3 = (0.5*R + 0.5*R2)
R and
R2 are the red channels of the two rectangles. My formula seems to make sense, but I'm not certain that it's correct. I also don't know how to handle the rectangles' alpha channels. So I was hoping someone could explain how it works, or take a look at my example and see what I did wrong. Thanks!
https://dl.dropbox.com/u/17269641/transparency_b.gm81