Re: [AD] memory bitmap blending

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


On Wed, December 10, 2008 10:07 am, Elias Pschernig said:
> Now for A5, I think the best way is one of the following two options:
>
> 1) Keep the current way, and say destination alpha already is complex
> enough that you should not use A5 blending any longer, but fragment
> shaders (our design goal after all was to only support a few simple,
> common blending operations and defer everything else to shaders - no
> idea if blending two alpha bitmaps together can be considered a common
> operation)
>
> 2) Provide something identical to OpenGL:
>
> al_set_separate_blender(src, dest, alpha_src, alpha_dest, color)
>
> and al_set_blender would just be a shortcut which has alpha_src=src and
> alpha_dest=dest.
>
> It shouldn't be hard to implement - just add two more blender variables
> to the state for alpha, replace glBlendFunc with glBlendFuncSeparate for
> the OpenGL implementation, do something analogous for DirectX, and
> update the memory blenders.

I'm all for option 1. AFAIK d3d doesn't even support destination alpha, at
least on my card (and it's fairly new).

The memory blenders should probably not even touch the alpha of the
result except to set it to 1.0. The colors are blended at that point.
We already decided not to keep the destination alpha blitting modes
so it's an easy decision.

Trent :{)>




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