nanogui: Re: Qusetion abuot Nano-X alpha blending
Subject:
Re: [nanogui] Re: Qusetion abuot Nano-X alpha blending
From:
Alex Holden ####@####.####
Date:
9 Jul 2005 19:07:06 +0100
Message-Id: <AA67FEB1-6EC1-45D1-A2D2-5C4284F5E120@linuxhacker.org>
On 9 Jul 2005, at 15:30, Greg Haerr wrote:
> As I think I mentioned in an earlier email, nano-X doesn't actually
> support software-based alpha blending, it only works when running
> with a hardware-based framebuffer that supports ARGB (32-bit)
> alpha blending.
GrNewAlpha() is one of the functions in the microwin-aph alpha
channel support. I believe the Importek guys encountered it in Nano-
breaker, the game I wrote to demonstrate some of the flashy visual
effects the alpha blending support in microwin-aph could be used for.
It worked by treating alpha channels as a special type of offscreen
drawing area. You could either construct one on the fly by using
ordinary drawing operations on a blank alpha channel (created with
GrNewAlpha()), or you could load one from an image file (PNG or
transparent gif) and then potentially modify it by drawing to it. The
actual blending operations were performed using the GrCopyAreaAlpha()
function which was the same as GrCopyArea() except it also took an
alpha channel ID and a flag specifying which type of blending
operation to perform. I think anyone interested in having decent
alpha channel support in Microwindows should take a look at the code
in microwin-aph and consider whether it would be worth porting it
forward. The hardest part was adding the alpha blending support to
the low level drivers (it's all software based, which unfortunately
means it needs a fairly fast CPU to get decent realtime effects). If
you must reinvent the wheel, think hard before discarding the ability
to create/load alpha channels into a pixmap-like object and perform
drawing operations on them as if they were pixmaps: the range of cool
visual effects you can achieve by drawing on alpha channels is
staggering (see Nano-breaker for some fairly simple examples).
--
------------ Alex Holden - http://www.alexholden.net/ ------------
If it doesn't work, you're not hitting it with a big enough hammer