Re: [AD] correct behaviour for additive blending?

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


On Sat, 2010-03-13 at 09:22 +1100, Peter Wang wrote:
> Am I doing something wrong or is this a bug?
> 
> Here I draw two intersecting lines with additive blending.
> On the offscreen bitmap the colour is as I expect (g=50; g=100 at the
> intersection).  On the backbuffer the colour is only half as much (g=25;
> g=50 at the intersection).

Here both look exactly the same (using OpenGL). I assume you use OpenGL
as well, and I assume it has a version of at least 2.0.0. Which means
there's probably a bug somewhere in our OpenGL code which is somewhat
non-deterministic.

What happens if you comment out the offscreen drawing? I.e. if you have
just these 3 lines and never change the target bitmap: (Since you're
saying the color is wrong on the backbuffer and not on the offscreen
that also should reproduce it, right? But looking at that test case I
assume you actually meant the other way around...)

al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1,1,1,1));
al_draw_line(100, 150, 200, 150, al_map_rgb(0, 50, 0), 0);
al_draw_line(150, 100, 150, 200, al_map_rgb(0, 50, 0), 0);

But anyway if that's already wrong, does it still draw the lines with
color 25? What if you use ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA instead?

-- 
Elias Pschernig <elias.pschernig@xxxxxxxxxx>





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