# difference between multiplicative and subtractive blending?

This topic is 4876 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I've been looking around a bit, but I'm having trouble finding a clear answer anywhere. What exactly is multiplicative alpha blending? I think its src color * dest color, which you can do with a src factor of zero and a dest factor of src color, right? that confuses me though - the guy who taught me alpha blending said those parameters were subtractive blending - so what's going on here? thanks in advance for your help. Eli

##### Share on other sites
Src * Dest is definitely multiplicative blending. To a beginning graphics programmer, it may be confused with subtractive blending because multiplying the color values effectively darkens the result, if both arguments are in 0...1 range (very common).

Subtractive blending actually is Src - Dest, and it also usually darkens the image (unless you have negative dest parameter).

EDIT: When talking about the framebuffer multiplicative blending, the source blending function should be D3DBLEND_DESTCOLOR, destination blend function should be D3DBLEND_ZERO and the blening operation be D3DBLENDOP_ADD. This effectively multiplies the source color with the framebuffer color, and adds zero (because we don't need the destination color as explicit source color). This is effectively the same as src = zero and dest = srccolor.

[Edited by - Nik02 on September 15, 2005 3:33:21 AM]

##### Share on other sites
so subtractive blending is a different op entirely? is it src color * src alpha - dest color * inv src alpha then?

and for multiplicative blending, is there any difference ( i know theres not one mathematically, but performance-wise ) between doing

src blend * 0 + dest color * src color and

src blend * dest blend + dest color * 0?

##### Share on other sites
You can enable subtractive framebuffer blending as follows: Blendop = subtract, src = one, dest = one. To subtract destination from source, use inverse subtract blendop.

As for which multiply is faster: it could depend on the hardware - there is a possibility that the operation is short-circuited depending on whether either source or destination is zero or one. Haven't profiled this particular feature, though, as I rarely need exotic framebuffer blends in my programs.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 31
• 16
• 11
• 10
• 11
• ### Forum Statistics

• Total Topics
634115
• Total Posts
3015595
×