Brightness effect that preserves alpha?

0 favourites
  • 5 posts
From the Asset Store
Is a system for building scorecards and achievements online for use in games Using this system, you can create a scorebo
  • I wanted to use the brightness effect to create a black outline of my sprite (that I use for a specific game mechanic).

    More graphically speaking I have this

    Original Pic

    and I want to get this (through a smooth darkening animation (so using animations is out the question).

    Darkened silhouette

    However, after applying the brightness effect I actually got this:

    Non-alpha brightness

    The problem is that the effect does not preserve the alpha of the original sprite.

    Is there currently a way to get a brightness effect that does preserve alpha?

    Thanks in advance

    PS: I apologize if this is not the correct place to post but I wasn't sure if this was a bug (as most of the other effect do seem to preserve alpha) or a "how do I do?" (because there are well-known ways to do this) or a feature request (because that it is something that is known to be missing)

  • In the meantime, the "exposure" effect seems to also do something similar and it does preserve alpha. Hopefully this is not that much computationally intensive than the regular "brightness effect".

  • Try using the 'Set color' shader instead.

  • Thanks for the reply. Set color is slightly different though, as there is no value in which the object is presented as it would be normally (Brightness = 100 means no change applied).

    In any case, is there some sort of rule or reason for preserving alpha on some color effects and not in others?

    No biggie though, worst case scenario I would create another effect "alpha preserving brightness" on my own.

    Thanks again and happy new year!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • A final tip for this.

    If there is an effect that does not preserve alpha and you want it to preserve alpha, go into your effect directory and find the name effect you want to edit.

    1) Open <effect_name>.fx

    2) See if you can find any of the following lines of javascript code:

       front.rgb /= front.a;

       front.rgb *= front.a;

    3) Comment them by adding "//" to the beginning of that line

    4) Save with a different name

    5) Open <effect_name>.xml and make sure to change the id that its found between "<id>" and "/<id>" to another value (each effect is required to have a different id).

    6) Save with the same name as your .fx file

    7) Close and Open C2 and use your new alpha preserving effect

    Of course, this does not work with every effect but I could at the least apply it to the "brightness" and the "vignette" effects that I wanted to use in my project.

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