Squeak said:
At the risk of sounding stupid, what is the "multiply" in multiply blending?
I always imagined that alphablending was just the weighed average of the two values being blended.
I know signed multiply blend from Photoshop, it seems like it stops the blending at certain value, but what is the difference between that and colour clamping?
The kind of simple alpha-blending available in a fixed-function pipeline usually has some kind of equation.
In the case of the PS2, its (a-b)*c + d.
You have a choice for what you can substitute for a,b,c or d, but it's not completely flexible. In the PS2 you cannot have a colour channel for c, only for a, b or d. This means you can only multiply by alpha or a constant value (i.e. a single value for all of RGB).
Your "weighted average", which is typical for fading stuff in or out (semi-transparent effects) then you can use:
output = (Fragment - Framebuffer) * Alpha + Framebuffer
Rearranging this:
output = Fragment * Alpha - Framebuffer * Alpha + Framebuffer
output = Fragment * Alpha + Framebuffer - Framebuffer * Alpha
output = Fragment * Alpha + Framebuffer * (1-Alpha)
Which is a basic linear interpolation:
If Alpha=1, the output is Fragment.
If Alpha=0, the output is Framebuffer.
Anything in between is a smooth blend.
However the most basic lighting typically needs to use an equation like:
output = fragment colour * lighting colour.
So if lighting is dark, you get a dark version of the texture, if lighting is brightly coloured you get a tinted version of the texture.
You can do that per-vertex (the fragment colour is a product of the linearly interpolated vertex colours and the texel colour), but you cannot do it in the alpha blend unless you use monochromatic lighting and encode the light value in the alpha.