PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Opacity questions

Hi Johan :)

1) I'm looking at gapidraw 2.02 docs and I've found that
BltFast has two opacity options:

GDBLTFAST_OPACITY and GDBLTFAST_FXOPACITY

was/is there any difference or it's just two ways to do
the same?


2) Any chances of getting per-channel opacity in the
future? I mean an opacity affecting only red channel
but leaving all other channels the same.
IMO it'd allow some very nice effects and it
would even be faster than "opaciting" all three channels
at the same time.
Also it would be nice to have an "one pass blit & opacity",
doing the blit and opacity calculation in a single pass:
it'd probably accelerate opacity calculations a lot in
places we're using opacity to shade or light...

TIA :)
Kak
Hi,

1) I'm looking at gapidraw 2.02 docs and I've found that
BltFast has two opacity options:
GDBLTFAST_OPACITY and GDBLTFAST_FXOPACITY
was/is there any difference or it's just two ways to do
the same?


GDBLTFAST_OPACITY defines the transparency of the source surface
GDBLTFAST_FXOPACITY defines how much of the effect will be visible on the source surface when bliting (similar to the effect opacity slider you have in Photoshop when you use layers with effects such as Multiply)

2) Any chances of getting per-channel opacity in the
future? I mean an opacity affecting only red channel
but leaving all other channels the same.


Maybe.. I am not sure at the moment though... I'll add it to my "investigate" list... :)

Also it would be nice to have an "one pass blit & opacity",
doing the blit and opacity calculation in a single pass:


Um.. Not really sure what you mean here :).. Blitting with opacity is done in one pass right now (i.e. source is read and blended with background in one pass).
Johan wrote:
Maybe.. I am not sure at the moment though... I'll add it to my "investigate" list... :)

great :)


Um.. Not really sure what you mean here :).. Blitting with opacity is done in one pass right now (i.e. source is read and blended with background in one pass).


I mean specifying two bitmaps, one for the main bitmap and another one for the opacity bitmap (like alpha blit with 2 surfaces but with opacity instead of alpha blit). My purpose is trying to get something like tipical polygon multitexturing, but applied to 2D to light backgrounds.
Kak wrote:
I mean specifying two bitmaps, one for the main bitmap and another one for the opacity bitmap (like alpha blit with 2 surfaces but with opacity instead of alpha blit). My purpose is trying to get something like tipical polygon multitexturing, but applied to 2D to light backgrounds.


I am curious to know what difference you make between "alpha" and "opacity" bitmap. An "alpha bitmap" is usually used to specify the opacity of each pixel in the "image bitmap".
Thierry wrote:
I am curious to know what difference you make between "alpha" and "opacity" bitmap. An "alpha bitmap" is usually used to specify the opacity of each pixel in the "image bitmap".


from my point of view the main difference is that, while with alpha you define an "alpha bitmap" where you control which parts of the bitmap are doing alpha, with opacity the whole bitmap is drawn using alpha with a given constant color (thus faster, I suppose)

nice thing is that, now that you've done the question, I think that alpha blit fast is just what I'm asking for :)

gotta think a little bit before asking ;)