[Help][Away3D-OpenFL] Alpha Blending and Textures

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:

Hi, you happen to get a fix on that ?

This should be resolved in OpenFL, it is caused by not using premultiplied alpha, which was an issue on OpenFL “legacy”

1 Like

Thanks for clearing that one up singmajesty, was looking at http://blog.peteshand.net/load-assets-into-away3d-openfl-via-runtime-texture-packer/ and then found this and all of a sudden got worried. :slight_smile
Going to start hacking something together that depends heavily on sprites super imposed on a looped background. Soccer player headshots and stats, so I need alpha. Premultiplied Alpha it is.
Any place I can read up a bit more on this, if anyone has a link, would be very handy.

We “bake” the alpha into the color of our textures, in GL, when blending occurs, it works naturally like you would expect. Otherwise, semi-transparent pixels will over multiply and result in fringe pixels that are the wrong color

This was a day one feature of the current OpenFL renderer, it’s always enabled to prevent issues like above

1 Like

I got to look what that “bake” is and what software can I get that from for the output files. Thanks singmajesty.