Implemented Additional blendmode in Mojo2

Holzchopf

Moderator
Staff member
Joined
Jul 31, 2017
Likes
152
Location
Bern, Switzerland
#1
I'd like to have an additional blendmode. One with
Code:
glBlendFunc GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA
instead of
Code:
glBlendFunc GL_ONE,GL_ONE_MINUS_SRC_ALPHA
The latter is used for Blendmode.Alpha, former is the typical blendfunc one uses when images aren't pre-multiplied (meaning colour channel values multiplied with alpha values when the image is loaded).

I'd like to introduce this into mojo2/graphics.cxs myself. But before I do, I wan't to make sure to use an adequate name for the newly introduced blendmode. Which one would you prefer?

  • FullAlpha (because it's using the full "alpha" capability of glBlendFunc)
  • Alpha2 (there's a Multiply2 already so maybe adding nondescript numbers is the way to go in Mojo2)
  • DirectAlpha (because it's going to be used when the images aren't pre-multiplied but instead the blending is done directly upon drawing)

Looking forward for your feedback ;-)
 

Holzchopf

Moderator
Staff member
Joined
Jul 31, 2017
Likes
152
Location
Bern, Switzerland
#3
Oh god, no! NOOOOO! I wrote the description in a way I thought would make clear that I don't approve of it. Multiply2 unfortunately is undocumented and therefore might not even be known. If I wouldn't have mentioned it, no one would contemplate Alpha2. Maybe? My fault! I shouldn't have put that option up at all... :rolleyes:

In my opinion, neither Multiply2 nor Alpha2 are (or would be) well chosen names. If they at least end up in the docs, that would be great. But I can only provide the documentation for Alpha2, since I certainly don't feel like analysing the effect and use case of Multiply2.
 

Holzchopf

Moderator
Staff member
Joined
Jul 31, 2017
Likes
152
Location
Bern, Switzerland
#4
I'd really love to see some more feedback. We should be happy that we as community can help improving Cerberus and should celebrate this by participating and sharing opinions concerning new ideas ;)
 

Holzchopf

Moderator
Staff member
Joined
Jul 31, 2017
Likes
152
Location
Bern, Switzerland
#6
I do. But I want people to get involved ;-) Imagine one day, when Cerberus X is really big and well known, you can say "yeah I helped developing it"

(aren't you sold yet? sigh...)
 

MikeHart

Administrator
Staff member
Joined
Jun 19, 2017
Likes
427
Location
Germany
#7
I should have added.... don't do it for the fame/money :)

About getting involved... most people just use software as it is and don't care further.

Imagine one day, when Cerberus X is really big
This made me smile. Someone can always dream... and should!
 

MikeHart

Administrator
Staff member
Joined
Jun 19, 2017
Likes
427
Location
Germany
#8
Btw. if you want to submit more extensions to CX, please get used to Github and submit your changes through that.
 
Last edited:

MikeHart

Administrator
Staff member
Joined
Jun 19, 2017
Likes
427
Location
Germany
#15
Ok, I have reconstructed @Soap addition from back then. Still need to come up with names for the docs. Any ideas? I have put them there with the glBlendFunc but the description needs to be added.
 

Holzchopf

Moderator
Staff member
Joined
Jul 31, 2017
Likes
152
Location
Bern, Switzerland
#16
Ok, your function was implemented then already under the name Opaque2. Sorry. :-/
That's OK, Opaque2 isn't even a catastrophic name ;-)

The extra column in the docs makes already quite a good explanation. The descriptions are hard to come up with. Is it possible to add images to the docs?
 

MikeHart

Administrator
Staff member
Joined
Jun 19, 2017
Likes
427
Location
Germany
#17
Yes, should be possible, if not, I make it possible. As I need that too. But I have to look into this myself.
 

Holzchopf

Moderator
Staff member
Joined
Jul 31, 2017
Likes
152
Location
Bern, Switzerland
#19
Just checked: you can add plain html in a .cerberusdoc file. This means, there are plenty of options how to put an image into the docs:
  1. img tag with base64-encoded image data. Pro: doesn't depend on other files to be copied. Contra: Increases .cerberusdoc file drastically.
  2. img tag with src="data/yourfile.png". Pro: doesn't increase docfile. Contra: yourfile.png has to be copied to docs/data
  3. img tag with src="../../modules_ext/module/cerberusdoc/yourfile.png". Pro: you can simply include the graphics in the module you provide, the user doesn't have to copy anything. Contra: User must extract your module to modules OR modules_ext depending on what directory you had in mind.
Edit oh and I will look into the BlendMode docs tomorrow.
 

MikeHart

Administrator
Staff member
Joined
Jun 19, 2017
Likes
427
Location
Germany
#20
@Holzchopf I have uploaded a mod to Makedocs to add Markdown image links.

You can now add an image like this:

upload_2018-2-20_14-13-52.png


Which is basically

![Alternative text](image link)
To store them with the docs file and and have the image automatically copied into the html output...

upload_2018-2-20_14-16-56.png


The data folder has to named the same as the cerberusdoc file.
 

Attachments

Top Bottom