gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Blending: lighten and darken

#3720 - Shu - Thu Mar 06, 2003 1:27 pm

Does anyone knows how can I do a single sprite to be affected by lighten or darken effect?
I have succeeded on doing alpha-blending for a single sprite using REG_BLDMOD and REG_COLEV. But, when I tried to use the same code, only changing the REG_BLDMOD mode flag to lighten and darken and using REG_COLEY to control the amount of fade, all the sprites were affected...
Does anyone has a solution for this case? Source code will be cool :) .

Thanks,

Shu

#3722 - DekuTree64 - Thu Mar 06, 2003 4:22 pm

Try setting the sprite alpha flag (bit10 of attr0), and see if it does anything. I know with blending mode 0, it will only blend sprites with their alpha flag set, but I've never messed around with lighten and darken.
Or if that doesn't work, you could just make a solid black or solid white tile and use a layer to blend with the sprite you want to lighten/darken, unless you need all your layers for other things, then the only way would be to give the sprite a unique palette (unless you're using 256 color sprites, then you're out of luck) and blend the actual colors yourself (that's how I do fades, so I can use the HW alpha for shadows).