About Monkey 2 › Forums › Monkey 2 Programming Help › Extending blendmodes
This topic contains 6 replies, has 2 voices, and was last updated by
Gwenel
7 months, 3 weeks ago.
-
AuthorPosts
-
August 27, 2018 at 8:53 am #15334
I discovered I need to add blendeffects for an effect to look just right, of course a shader could do that but glsl not my territory so I think a new blendmode will be a good option for me.
How would you extend blendmodes most elegantly?
One important issue is that I would like to do that so others can easly use it so I want to avoid actually go into the sourcecode of the language I rather extend what is needed to extend.
August 28, 2018 at 7:33 am #15341blendmode is related to mojo/opengl’s drawops. I don’t think you can just extend it.
August 28, 2018 at 11:13 am #15342Okay is a shader the better option in Monkey2?
We are a small group of peple that makes 2d indie games on our sparetime and we got stuck on how to make the main character (and also the actual game ui itself actually) to “eat” through the “fog” around them.This is an important part of the game play itself and we need to be able to diminish the fog efficiently around enemies.
A simple subtractive blend mode would suffice but here was only multiplicative and additive modes.
August 28, 2018 at 11:16 am #15343Half the game will be written as a shader soon because everytime shader is the answer
August 28, 2018 at 11:19 am #15344Can we have a shader section here to discuss shaders?
August 28, 2018 at 8:38 pm #15346Mark has taken a “Monkey2 holiday” of (at least) one month because he just got a new full time job. But he is answering some Qs on discord, and there is a shader section (with almost no discussion).
Some monkey2 users have already done some nice shaders stuff, it’s on github. If I have some time tomorrow, I’ll try to find the links to the repos.
But Mark can tell you if substractive blendmode is doable within mojo without too much hassle.
Have you seen canvas.monkey2 file? That’s where blendmode is. Monkey2 source files are easy to read and modify. If you add substractive blendmode (I’m supposing you know opengl here) you can then request a pull and it’s good for everybody!August 28, 2018 at 10:08 pm #15347Ya I think you just need to to add 3 lines to graphicsdevice.monkey2
Monkey12345Subtractive = 5 ' line 22Case BlendMode.Subtractive ' around line 606 somewhereglBlendFunc(GL_ZERO,GL_ONE_MINUS_SRC_ALPHA) ' 607If I remember my opengl correctly which I hope I do.
Maybe we should discuss what everyone wants to be added and compare the wishes to what is common over all the platforms and also easy enough to add and just do it.
I know for instance that theres ppl that might want the logic Blendmodes, and of course all the 16 standard ones. But to talk about which ones that ppl find *really* useful could be an interesting discussion.
-
AuthorPosts
You must be logged in to reply to this topic.