Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding more blending modes
#2
Hi!
Built-in blending tables are created in file Tables.c, in CreateBlendTables() function:
https://github.com/megamarc/Tilengine/bl...bles.c#L20

To add new modes, just expand the public enumeration TLN_Blend here:
https://github.com/megamarc/Tilengine/bl...gine.h#L83

And add the corresponding blend formula in the aforementioned CreateBlendTables()  with the desired effect.

For example formula for hypothetical logical AND should be:

Code:
_blend_tables[BLEND_AND][offset] = (a & b);

Parameters a and b are brightness levels between 0 and 255
Reply


Messages In This Thread
Adding more blending modes - by System64 - 05-09-2022, 07:58 PM
RE: Adding more blending modes - by megamarc - 05-09-2022, 08:55 PM
RE: Adding more blending modes - by System64 - 05-09-2022, 09:11 PM
RE: Adding more blending modes - by System64 - 05-10-2022, 07:53 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)