Porting subtract shader to OpenGL to use with Android?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hey guys!

    I've been working with my upcoming horror adventure game Please login to see this link. like there's no tomorrow.
    I've designed the game and the controls so I could port it over to android soon after the release (this Halloween). I thought I could replace the shaders I use, but didn't think of subtract shader which is essential for my lightning system.

    I'm by no means technical guru with these stuff, so I'm asking if someone knows would it be possible to somehow port subtract shader to OpenGL and use with Android exporter?

    Thanks! :)

    Currently working on Please login to see this link.
    Released games: Please login to see this link. and Please login to see this link.

  • Can't edit so I'll just reply here.
    Okay, it seems subtract is sort of supported already, though I can't use it as a layer effect. Not sure how to set up lightning system otherwise.

    Any ideas? :)

    Currently working on Please login to see this link.
    Released games: Please login to see this link. and Please login to see this link.

  • Sorry guys I'll bump!

    I'm trying to figure if it's possible to make the subtract shader work as a layer effect for Android?
    I've also been thinking of alternative ways to do the similar effect, without shaders. But those methods have been quite performance intense.

    Does anyone know if this is possible, or have any suggestions? I'd need multiple light sources, and different shape of lights. Getting subtract to work on Android would be the best way. :)

    Thanks!

    Currently working on Please login to see this link.
    Released games: Please login to see this link. and Please login to see this link.

  • piscesdreams, I'm doing my current lightning system similar to that. Using white active, and subtract as a layer effect. But using subtract for layer effect is not supported on android.
    You can use subtract shader on android, but not for the layer effect. If you use it in the active object, I don't think you can actually subtract from it, at least I have not figured how to do that.

    But yeah, phones are getting quite powerful these days so I believe supporting shaders could be the next big thing? Who knows! :)

    Anyway, a word from CT would be awesome!

    Currently working on Please login to see this link.
    Released games: Please login to see this link. and Please login to see this link.

  • This might be a little old - but I'm going to bump this thread because noone I have spoken seems to know how to sort this issue out. I'm having the exact same issue as J3sseM - anyone found a fix?

    Published games so far: Please login to see this link.
    Twitter: Please login to see this link.

  • Clickteam, are you planning to support shaders with android exporter?
    Would be awesome to know so we could design our games properly or to look alternatives.

    Currently working on Please login to see this link.
    Released games: Please login to see this link. and Please login to see this link.

  • Sorry we are all busy working on various things and its hard to read every post in the forums.

    I just spoke with Fernando and it is on his list to look into but there isn't a timeline on implementing it.
    One of the issues he can see concerning it is older devices and a performance impact on it.

    For the time being I would look at solutions besides shaders.

    Please login to see this link.

  • I'll take that as a "no" then.

    As for workaround I'd be fine with that, but I can't figure how to make lightning effects without subtract shader. Surely I could position one big active with a hole in it on a player but I couldn't use multiple light sources that way.

    I could use tiles with alpha relative to position but that's insanely heavy, and wouldn't support light shapes other than circle, so it's no good either.

    Currently working on Please login to see this link.
    Released games: Please login to see this link. and Please login to see this link.

  • Hey Kisguri, porting DISTRAINT to android would be pretty simple if I could just figure out the lightning effects. However I don't see an easy solution for that except for getting subtract effect to work on layers (not saying that is easy though, I've no idea what that would take).
    Besides I'm working on something else so the "fix" should be rather straight-forward. That said no need, but thanks for checking.

    But sure if someone gets an idea I'd love to hear it out. :)

    Currently working on Please login to see this link.
    Released games: Please login to see this link. and Please login to see this link.

  • Oh no, Distraint must get to android! :(

    Sorry Jesse I just stumped on this thread now, but had a couple ideas to share, not sure if any would do for you but just in case..

    1) using the good old "hole" method with alphablend
    simply layering one "holed" object for each lightsource
    and setting their alpha blend to a "middle" value (100-120 or so)

    totally crap example pic (sorry - a bit rushed now, had no time to pull out a proper alpha gradient light XD):

    Please login to see this attachment.


    knowing how many lightsources you have on screen,
    you can easily set the right amount of blend needed to mantaing the same "darkness" amount when layering one darkness over the other

    2) I think the "tile" method you mention could be tested, assuming your screen size will be far smaller than the windows version,
    and so you won't proportionally stretch to a very small character, but rather keep less frame area on screen
    so you could do with, say, 32x32 tiles, about 225 static objects on screen (less if you go with a lower resolution than 640x360),
    you would only alter their blend relatively to your light sources, maybe this shouldn't totally kill the phone if frame rate is low enough...
    not 100% sure but I think this could be worth a try ..of course if you can live with "blocky" lights XD

    a selection of my Fusion examples can be found Please login to see this link.

  • "Blocky" lights would be ok in the games like minecraft / terraria i think, additional 200 objects may totally kill game performance.

    I had same problem. I wrote to Fernando some time ago and looks like the cuting holes on the layer on windows runtime is a bugged implementation of subtract effect (with directx renderer only) so users use it to make fake lights, but we can not make same effect on mobiles with opengl renderer.

    Would be great if CT could resolve this problem to allows us to make some light effects on mobiles.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!