Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Multiply blending mode anyone?

This thread is locked; no one can reply to it. rss feed Print
Multiply blending mode anyone?
sadelbrid
Member #15,200
June 2013

I am trying to implement a lighting system in my applications. I understand a really simple way to do it: create a light map and multiply it to the destination. al_set_blender() is used to set blending functions. Does anyone know a combination of parameters that would mimic multiplying the rgb values? Or is there a more simple way to do it...

-Thanks!

P.s. here is the function definition and examples: https://www.allegro.cc/manual/5/al_set_blender

ph03nix
Member #15,028
April 2013
avatar

I don't think you can with allegro 5, but you can with 5.1

http://alleg.sourceforge.net/a5docs/refman/graphics.html#al_set_blender

J-Gamer
Member #12,491
January 2011
avatar

It looks like you want the last one specified in the manual:
al_set_blender(ALLEGRO_ADD, ALLEGRO_DEST_COLOR, ALLEGRO_ZERO)

" There are plenty of wonderful ideas in The Bible, but God isn't one of them." - Derezo
"If your body was a business, thought would be like micro-management and emotions would be like macro-management. If you primarily live your life with emotions, then you are prone to error on the details. If you over-think things all the time you tend to lose scope of priorities." - Mark Oates

Go to: