Added blend mode

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
571
Hi I added a subtractive blend mode for anyone who wants it, just replace the graphics.cxs file inside your Cerberus folder with this one.

Here's an example how a shape would be painted using normal paint mode and the new subtractive mode.
Normal drawing versus subtractive
alpha.png
subtractive.png
 

Attachments

  • graphics.cxs.zip
    17.6 KB · Views: 37

Phil7

Administrator
CX Code Contributor
3rd Party Tool Dev
Joined
Jun 26, 2017
Messages
539
Moved this thread from general.
 

Holzchopf

Moderator
3rd Party Module Dev
Tutorial Author
Joined
Jul 31, 2017
Messages
482
Thanks. Interesting blend mode, I will check if this can find its way into the official Cerberus. I see you changed the blendfunc for Opaque2 in your code - any reason for that? Would a glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA) also be of interest?
 

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
571
Good catch, Opaque2 was not meant to be changed at all.

This is the file you want to use.
 

Attachments

  • graphics.cxs.zip
    17.6 KB · Views: 47

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
571
This mode is meant for games like Worms or Lemmings, you erase mountains and levels and
you may use SetAlpha 0.5 for instance to erase something softly.

Being able to do this with full hardware acceleration is extremely practical :cool:
 
Last edited:
Top Bottom