Re: [AD] premultiplied alpha

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2010-10-29, Elias Pschernig <elias.pschernig@xxxxxxxxxx> wrote:
> > 
> > > Another idea would be to use pre-multiplied alpha by default, as Shawn
> > > Hargreaves does in XNA [1] :P But I don't really know enough about this
> > > I guess, yesterday is the first time I understood where i can even make
> > > a difference...
> > 
> > For what it's worth, we convert to pre-multiplied alpha when setting
> > the application icon.
> > Which prompts me to go and check what the native image loader on OS X
> > does with the colour components when loading a bitmap with an alpha
> > channel and make sure it does the right thing.
> > 
> > Other than that, is it essential to have this for 5.0? I guess it is
> > if blending won't work otherwise. It doesn't seem like it would break
> > the API to include it from 5.1 onward (except of course when making it
> > the default, but we don't have to do that) so in that sense it's not
> > that this is our one chance to "get it right".
> > 
> 
> I think the flag for bitmap loading is important, otherwise you couldn't
> use pre-multiplied alpha at all.

Isn't it just a case of multiplying in the alpha after loading?
Granted, it's slower.

> As for making it the default I don't know. Maybe it's best to change the
> default blend mode from ALPHA/INVERSE_ALPHA to ONE/ZERO. That way we
> have no default any longer, everyone needs to call al_set_blender at
> least once in each A5 program and decide the used blending for
> themselves.

I'm fine with leaving it as it is.

Peter




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/