Skip to content
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

Alpha Blending Issue #40

Open
dimumurray opened this issue Mar 22, 2015 · 3 comments
Open

Alpha Blending Issue #40

dimumurray opened this issue Mar 22, 2015 · 3 comments

Comments

@dimumurray
Copy link

Here's an odd thing that keeps cropping up. I have an app with a number of overlapping 3D planes. Each plane has a texture applied with alpha transparency. On native targets, a slight white outline/glow appears where the textures overlap. On the HTML5 target the white glow is even more prominent.

Here are some images to illustrate.

Ideally this is what I want:

The native(windows) target has white outlines but they are near negligible so I won't bother posting it...

The HTML5 target, however, produces this:

I have no idea where the "white halo" comes from.

Here's the code if anyone cares to investigate:
https://github.com/dimumurray/AlphaTest

@Greg209
Copy link
Member

Greg209 commented Mar 22, 2015

I've been recently experiencing this issue myself. I've not found the problem yet so I'll need to investigate further. Thanks for logging it.

@Type1J
Copy link
Contributor

Type1J commented Apr 18, 2015

This is caused by the way OpenFL is storing pixels in BitmapData.

If you change the lines:

    splatterMaterial.alphaPremultiplied = true;

and

    glyphsMaterial.alphaPremultiplied = true;

to

    splatterMaterial.alphaPremultiplied = false;

and

    glyphsMaterial.alphaPremultiplied = false;

Then you will get the correct behavior on html5 and native, and a different incorrect behavior in flash.

@Greg209 Please look at openfl/lime#409

@Type1J
Copy link
Contributor

Type1J commented Apr 25, 2015

openfl/openfl#622 fixed native. The html5 target still has some problems. I'm not sure why just yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants