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
and I want to get this (through a smooth darkening animation (so using animations is out the question).
However, after applying the brightness effect I actually got this:
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".
Develop games in your browser. Powerful, performant & highly capable.
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!
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
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.