Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Subtractive Blending

This thread is locked; no one can reply to it. rss feed Print
Subtractive Blending
Michael Moffitt
Member #15,246
July 2013

Hi everyone, I've played around with Allegro's blending mode parameters, but I'm not sure I am exploring as fully as I could be to get this desired effect.

Basically, let's say I have a bitmap already drawn called A. I have another bitmap, B, which has not yet been drawn.

When I draw B on top of A, I want the result to be A - B, with all negative values clamped to zero.

In reality, A represents a buffer to which I am blitting most of the game. For the final image B, I want that one to be blended with subtractive blending while the others are all normal.

Is this something that can be done without massive complication?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Go to: