[Effect] Alpha Threshold

  • Finally got the time to release this.

    Description

    Alpha values below the threshold are converted to transparent and above to opaque with a smoothness control.

    It's useful to simulate metaballs when applied to a transparent layer and get fluid-like effects. When combined with physics can simulate a pseudo liquid, and with particles can simulate fire.

    Parameters

    Threshold: Alpha threshold from 0 to 100. Controls where to put the edge based on the opacity value.

    Smoothness: Controls the smoothness of the edge.

    Flat Colors: Set to 1 to unpremultiply the colors and make them flat. 0 preserves the black shading caused by premultiply.

    <img src="https://dl.dropbox.com/u/7871870/construct/Effects/alpha%20threshold/prr-alpha-threshold.gif" border="0">

    View Demo

    Downloads

    Download Effect

    Download Demo capx

    How to Install

    Just drop the two files under your "Construct2/Effects/" folder.

  • Awesome!

  • Indeed, awesome effect, I specially like the fire one. Well done! <img src="smileys/smiley20.gif" border="0" align="middle" />

  • Really like it :)

  • Wow, very nice effect, thank for sharing it !

  • FANTASTIC!!!

  • Very cool, I hope the peformance doesn't take a hit.

  • Does increasing 'smoothness' impact performance?

  • No, you can use the maximum visual appealing smoothness without problem. I believe only 'Flat Colors' parameter can have some impact on performance and that should probably be not that meaningful.

  • OK, sounds good. When you say that 'flat colors' has an impact, should I have it on or off? I'm using a 'set rgb' filter anyway so it's meaningless to me whether it should be on or off.

  • When 'On' it makes one more division operation, but I think you don't need to worry much about that.

  • Thanks for the effect :)

    However i found that when i create a layer (gui for example) above the layer with the alpha threshold effect, it won't work anymore :(

  • Ize

    i cannot reproduce this bug you are talking of. what objects on the gui layer? Maybe those interfere with the shader, or you might have accidently placed them on another layer.

    Animmaniac

    congrats, this effect is awesome =)

    especially with rojos outline shader ^^

  • oppenheimer

    it's enough to create a third layer for me and then it bugs out

    take the demo .capx, each layout has layer0 and layer1 create another layer (can be empty) and test it...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi Ize

    Apparently I made a mistake in the demo and set an event to create the metaball objects in the layer with index 2, while there's only two layers and the maximum index is 1. Probably something I missed when cleaning the example for release.

    Fortunately C2 corrects my mistake by automatically getting the next valid index instead of crashing, which is 1. When you create a new layer, index 2 starts to be valid and the objects are created in a layer that doesn't have the effect.

    So, there's no problem with the effect, it's working as intended. It's just my example that's faulty. I will correct it and reupload later.

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