Extending blendmodes

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.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #15334

    Gwenel
    Participant

    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.

    #15341

    abakobo
    Participant

    blendmode is related to mojo/opengl’s drawops. I don’t think you can just extend it.

    #15342

    Gwenel
    Participant

    Okay 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.

    #15343

    Gwenel
    Participant

    Half the game will be written as a shader soon because everytime shader is the answer 😆

    #15344

    Gwenel
    Participant

    Can we have a shader section here to discuss shaders?

    #15346

    abakobo
    Participant

    Mark 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!

    #15347

    Gwenel
    Participant

    Ya I think you just need to to add 3 lines to graphicsdevice.monkey2

    If 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.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.