[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Unexpect blit behavior when using BLEND_ADD



On Wed, Apr 16, 2008 at 11:48 PM, Marcus von Appen <mva@xxxxxxxxxxxx> wrote:
>  Both surfaces contain alpha, so only alpha blending will be applied. The
>  BLEND_* args only work for cases where alpha blending cannot be
>  applied.
>  Should we change this to take alpha into account for the BLEND_* args as
>  well and only apply the default alpha blending, if no BLEND_* args are
>  passed?
>
I think if somebody passes the BLEND args, their intent is pretty
clear that they want you to respect the blend args passed, regardless
of whether or not the surface has alpha or not. If you pass BLEND args
and they don't change the operation at all, that seems like useless
behavior for the api.

... that being said, I absolutely think the end result of Lenard's
test is right - specifically if I do additive blend with a source that
has alpha of zero, the image should be unchanged, because RGBA is a
color+transparency mode in other contexts (i.e. an alpha of 0 means do
nothing). In terms of art production, alpha'ing out pixels is a great
way to make art that is a particular color but only lightly applied.
Also, it can be useful to render the same art with both multiplicative
and additive blending to get a glowy effect that doesn't saturate over
white.