Re: [Paracomp-devel] Standard Alpha Blending problems
Brought to you by:
shreekumar
|
From: Shree K. <shr...@hp...> - 2008-06-25 10:40:40
|
Hi James,
James S Perrin wrote:
> Shree Kumar wrote:
> This is what we don't understand. If presumably intermediate images
> generated from an over operation will be used in a subsequent operation
> and therefore the alpha needs to be maintained.
>
> If you have input images F0-3 then lets assume F0 OVER F1 and F2 OVER F3
> producing intermediate images iF0 and iF1 to produce the final composite
> we need iF0 OVER iF1 however if Alpha is not preserved by the
> operator iF0 and iF1 will not have the correct alpha values for the
> final operation?
>
> I0 + I1 I2 + I3 <-- correct Alphas
> \ / \ /
> iF0 + iF1 <-- incorrect Alphas?
> \ /
> Output <-- incorrect image?
>
Your conclusions about "incorrect Alphas" and "incorrect image" are spot
on. Alpha values you get out of the operation from Paracomp will not be
correct.
If you use ParaComp to do (I0+I1+I2+I3) in one swoop, then you'll get
the right image, but wrong alpha values again.
The right thing to do seems to be to fix Paracomp. Will changing
ParaComp's blending function from the current (faulty) equation
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
to an equivalent of
glBlendFuncSeparateEXT(
GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,
GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
work for you ?
Currently, I don't see anybody using the broken alpha value. So I see it
safe to fix this. Fixing this won't break existing apps either...
> I forgot to say we also see that translucent parts of the front image
> that are composited against "nothing" in the rear image are being
> attenuated.
That's interesting. Could be a bug. I'll look at this. Images, if you
can send them, will be useful.
Regards
-- Shree
|