-
Notifications
You must be signed in to change notification settings - Fork 449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Semi-transparent colors in sprites turn black on -Dnext #2026
Comments
I'm getting this also on linux64 with haxe 3.4.0, haxeflixel 4.2.0, openfl 3.6.1, lime 2.9.1.
As you can see, the effect is dramatic as soon as you're 1/255th less than full alpha, and gets worse from there. Code used: package;
import flixel.FlxState;
import flixel.FlxSprite;
import flixel.util.FlxColor;
class PlayState extends FlxState
{
override public function create():Void
{
super.create();
for (i in 0...256) {
var box = new FlxSprite();
var colour = new FlxColor(FlxColor.WHITE);
colour.alpha = 256 - i;
box.makeGraphic(10, 120, colour);
box.setPosition(10 * (i % 64), 120 * Std.int(i / 64));
add(box);
}
}
} |
This is maybe a problem with openfl 3.6.1. I had a similar problem before using only openfl. It was supposedly fixed october 2015: http://community.openfl.org/t/several-problems-with-swf-from-fla-and-windows-target/6628 |
@Tembac OpenFL 3.6.1 should have that fix then, it was released 2016-03-29. |
Ups, I have my years mixed :D jaja. |
@Beeblerox I wanted to see whether this will be fixed by #2068 - it seems the color of the sprite in the upper left is somewhat off on the FlxMaterial branch: vs Flash (expected): |
@Gama11 i will look into it. |
@Gama11 i think the problem on my branch is caused by shaders which suppose to work with premultiplied alpha. So in order to fix this i need to add new property to material and chose shader appropriately. You can check it yourself if you change
|
Code snippet reproducing the issue:
If I remove the
& 0x88ffffff
part, the sprite is plain red (which is good) on both legacy and next.Observed behavior:
(next)
Expected behavior:
(legacy and Flash)
The text was updated successfully, but these errors were encountered: