Re: Alphablending
- From: "jukka@xxxxxxxxxxxx" <jukka@xxxxxxxxxxxx>
- Date: 28 Apr 2006 15:07:46 -0700
I did not notice any partly transparency in your rendering.
You WILL notice lack thereof in your version. Put the edge of the leaf
over the red areas in the background picture. You will notice black
"seam" in some pixels. In my version there is *always* partial
translucency.
It looked just like plain Transparence to me. It still does.
So therefore I went for colorkeying to avoid the extra cycles.
Nope. The picture that I am using does not make the effect so apparent,
feel free to modify the *alpha* of the texture so that it does not have
most values close to 0 or 255. Try 60 to 180 and observe what happens,
127 would mix 50% background color and 50% sprite color.
Ok. What level of Alpha is used in your sample then?
The source says :
alphablend::setAlphaConstant(255,255);
That is CONSTANT alpha, my code is slightly more flexible than the
fixed blending in OpenGL at the time I wrote the code. The two alpha
"weights" there modulate the source and destination alpha before
blending. Thus, I can also "fade" sprites in and out without actually
touching the alpha of the background picture, or the source sprite's
alpha.
Since I am not interested in that, I set the constant alpha to maximum
(255). This *disables* the modulation with the constant alpha. This was
extra "complexity" or maybe "flexibility" that I didn't see important,
now you know what it was for, very perceptive to notice and ask about
it. :)
if you did alpha? Or if wrong, please explain what happens?
What happens, is that I mix the background and sprite color using the
sprite picture's alpha channel as factor how much I interpolate between
the two colors. The equation is quite clear on what is happening.
More fun effects are possible, for instance I could change the blending
function "on fly", maybe adding keyboard toggles to test different
blending functions, it used to be fun when playing around. Another
cheap trick is to have two buffers and mix them to previous so that old
color is *0.85 and new color is *0.15, this creates interesting "motion
blur" -like effect. Everything that is moving will leave a trail.. :)
.
- Follow-Ups:
- Re: Alphablending
- From: //\\\\o//\\\\annabee <Free
- Re: Alphablending
- References:
- Alphablending
- From: //\\\\o//\\\\annabee <Free
- Re: Alphablending
- From: hutch--
- Re: Alphablending
- From: //\\\\o//\\\\annabee <Free
- Re: Alphablending
- From: Chewy509
- Re: Alphablending
- From: Dunny
- Re: Alphablending
- From: //\\\\o//\\\\annabee <Free
- Re: Alphablending
- From: silk.odyssey
- Re: Alphablending
- From: //\\\\o//\\\\annabee <Free
- Re: Alphablending
- From: Dunny
- Re: Alphablending
- From: //\\\\o//\\\\annabee <Free
- Re: Alphablending
- From: Dunny
- Re: Alphablending
- From: //\\\\o//\\\\annabee <Free
- Re: Alphablending
- From: //\\\\o//\\\\annabee <Free
- Re: Alphablending
- From: jukka@xxxxxxxxxxxx
- Re: Alphablending
- From: jukka@xxxxxxxxxxxx
- Re: Alphablending
- From: //\\\\o//\\\\annabee <Free
- Re: Alphablending
- From: jukka@xxxxxxxxxxxx
- Re: Alphablending
- From: //\\\\o//\\\\annabee <Free
- Alphablending
- Prev by Date: Re: Alphablending
- Next by Date: Re: Alphablending
- Previous by thread: Re: Alphablending
- Next by thread: Re: Alphablending
- Index(es):
Relevant Pages
|