Object cannot have two webGL masking effects

0 favourites
  • 6 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • Link to .capx file (required!):

    dl.dropbox.com/u/41931267/MaskBug.capx

    Steps to reproduce:

    1. Create a new project with 2 objects: something as a mask and something to apply the effects to.

    2. Add two 'mask' webGL effects to the masking object.

    Observed result:

    Only the bottom effect has any effect.

    Expected result:

    Both effects should be applied on the bottom object.

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: N/A

    Operating system & service pack:

    Windows 7 home premium

    Construct 2 version:

    r117 business

  • I don't think we can make masks work together: currently it's pretty much by design that you can only use one mask per object. Masks work by returning an opaque image with the effect "baked in". Most mask effects also don't use the color of the image, just the alpha. So a mask followed by a mask naturally has the effect of using an opaque image on the last mask.

    Workaround: use a non-mask version of the shader. E.g. mask HSL, then ordinary hexagonal pixellate. This processes the "baked in" image from the mask, rather than masking the baked-in image with the background, and seems to achieve what you were after. If that's not what you're after, I think you might need to get in to writing some GLSL yourself.

  • Thanks, ASHLEY. I will certainly look into GLSL if I need some more advanced shaders. The hexagonal pixellate and adjust HSL were just for demonstration purposes.

    I just tried it, and it works but does some weird things. Using hexagonal pixellate again as an example, for some unknown reason it's actually turning the image upside down! Oddly, if I set the mask to any angle other than 0 degrees it works. This may well be a specific hexagonal pixellate problem with which I have little interest, but I thought you might like to know.

    dl.dropbox.com/u/41931267/MaskBug.capx

  • Re: flipping - it looks OK in Chrome, just seems to be an editor problem, can you confirm that's the case?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • sqiddster reminding myself so I can test when I get to a C2 pc.

  • Ashley, it happens for me in Chrome as well. (By the way, that text should say the only difference is their angles, not masks.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)