Re: Alphablending



På Fri, 28 Apr 2006 19:22:07 +0200, skrev jukka@xxxxxxxxxxxx <jukka@xxxxxxxxxxxx>:

< http://www.szmyggenpv.com/downloads/LeafONBk.Zip >

it is much closer then your is to mine, eh?

Btw. it still doesn't alpha *blend*, it seems to be doing somekind of
trivial color keying from looking at the rendered results. I don't see
the alpha component used for blending weight at all as would be
appropriate in this situation.

I did not notice any partly transparency in your rendering.
It looked just like plain Transparence to me. It still does.
So therefore I went for colorkeying to avoid the extra cycles.

If there is data: RGBA, RGB is the color and A is alpha component. It
can be used for a lot of interesting purposes, but when blending with
source factor set to "src alpha" and destination factor is set to "dest
inverse alpha" it means the blending equation is like this:

result = color1 * alpha1 + color2 * (1.0 - alpha1);

This case happens to be equivalent to:

result = interpolate(color1,color2,alpha1);

This will produce a "smooth" edges which are blended to background
gradually (the alpha component tells the strength of the color at each
sample).

Ok. What level of Alpha is used in your sample then?
The source says :

alphablend::setAlphaConstant(255,255);

If this means alpha = 1.0, then some additional operation must be performed on
your surface, because alpha 1.0 would make the backgound go fully away under the sprite?

In this sample :
< http://www.szmyggenpv.com/downloads/RBlissv002l.Zip >

Alphablending is performed if you select Options/About.

This peforms alpha between the background and the "dialog box". It does 100 levels.
From 0.01 to 1.0. As you can see, there is no background visible when alpha is 1.0
This is because alpha = 1.0 will fully make the background go away. This doesnt happen
in your app. The part of you bitmap that I replaced with a keycolor, should be visible
if you did alpha? Or if wrong, please explain what happens?

Conclusion: you appear to be doing color keying, or alpha compare.
Since you colored the "background" blue it could be just simple color
keying. All the same very interesting stuff.

Theres is alphablending in the the Section_FadeIn routine.



.



Relevant Pages

  • pre-multiplied alpha and convolutions
    ... I was just wondering why ConvolveOp in Java uses images with a pre- ... multiplied alpha to do convolutions. ... are premultiplied with the alpha component. ... BufferedImage has an alpha component, and the color components are not ...
    (comp.graphics.algorithms)
  • Re: Alphablending
    ... the alpha component used for blending weight at all as would be ... RGB is the color and A is alpha component. ... you appear to be doing color keying, ...
    (alt.lang.asm)
  • Re: Color.FromArgb & .NET CF
    ... Windows CE does not support alpha blending, ... Peter Foot ... Windows Embedded MVP ... > Is Alpha component of ARGB in .NET CF ignored? ...
    (microsoft.public.pocketpc.developer)
  • Re: IDirect3DSurface9 and alpha channels
    ... Run DXCapsViewer on this card. ... of hardware blending it offers (frame buffer alpha and texture stage ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: IDirect3DSurface9 and alpha channels
    ... textures rendering, then rest assured it doesn't support alpha blending at ... > Now as far as your question about the images and their alpha channel, ...
    (microsoft.public.win32.programmer.directx.graphics)