591 views
in Platform Packages by

Hi EW Team,

when I use exter bitmap, I found the alpha blending is confusing. 

The result is 

Actually, the white area should be apparent, but it obviously not.  When I change the extern bitmap value to be 0x50505050, it

behaves as correct as the right gray part.

So I 'm wondering that did it use premultied alpha? Cause I have seen you use glBendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA) 

Another question is when I tried it on soft 9.30 package, it is another effect as below(ignore the rotation):

What‘s the reason?

BR

Arnold

 

1 Answer

0 votes
by
 
Best answer

Hello Arnold,

yes, in case of OpenGL PP, the pixel data is stored as pre-multiplied values. Accordingly, the contents within the Extern bitmap has to be pre-multiplied correctly. Please see the example in the section: Bitmap color format EW_PIXEL_FORMAT_NATIVE variant RGBA8888, especially the usage of the macros EW_PREMULTIPLY_COLOR_CHANNELS, etc.

In case of the SW version, it seems that your PP also uses the pre-multiplied format. In such case if the pixel-values within the bitmap are not pre-multiplied, operations with the pixel values will cause overflows overwriting the adjacent color channels.

Does it help you further?

Best regards

Paul Banach

by
Thanks , it helps a lot!

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...