Translucency/Alpha channel

Coldstone now support translucency through alpha masks (it is as simple as using a PNG with an alpha channel instead of a PICT).

(url="http://"http://www.AmbrosiaSW.com/cgi-bin/ubb/forumdisplay.cgi?action=topics&forum;=Coldstone+Image+Gallery&number;=57&DaysPrune;=20&LastLogin;=")Check the Coldstone image gallery!(/url)
Also take a look to the (url="http://"http://www.AmbrosiaSW.com/webboard/Forum18/HTML/000009.html")Coldstone progress log(/url).

------------------
Dee Brown
Coldstone Game Engine developer
Beenox inc. - (url="http://"http://www.beenox.com")www.beenox.com(/url)

(This message has been edited by Dee (edited 05-31-2001).)

I must say, you all are doing fantastic work polishing the engine, and I expect to see great things. The screen shots already look much smoother and more fluid.

Saphfire

------------------

Marvelous! Good to see that you've been busy, especially adding such an extremely handy feature. Alpha masking will make Coldstone games that much more professional looking, and makes possible some of the features people have been asking about (weather, lighting effects, and the like.) Thanks, Dee!

------------------
Back in my day, we didn't have any of this here UBB nonsense. It was DiscBoard or nothing, and we liked it!
"In all matters of opinion, our adversaries are insane." - Mark Twain
"The answer is yes or no , depending on the interpretation." - Albert Einstein

what are alpha channels...?

------------------
Evil is as Evil does

Quote

Originally posted by Lorenoth:
**what are alpha channels...?

**

(I don't know how much tech talk you know, so pardon me if I talk down to you.)

"Glenn's computer graphics primer"

Background info - if you "don't know much 'bout graphics"
(edit)
More preliminary background material:
Ok, a computer image is made up of pixels (little dots of color on the screen.) The more pixels an image contains, the more detailed it can be, but also the more computer memory is required to describe it. In addition to increasing the number of pixels, a picture can be made "better" (but again, requiring more memory) by describing each pixel with more information. This amount of information is called "bit depth."

The earliest and smallest bit depth is 1 bit. Each pixel is described by 1 bit of data, where a bit is the smallest unit of computer memory, which can either be "on" or "off." Thus, each pixel can be "on", or "off", which usually means black, or white. You don't see a lot of one-bit graphics around these days. 🙂

4 bit and 8 bit color are the next smallest, and they work on similar methods. In each case, the image has attached to it a list of exact colors - 16 colors for 4-bit, and 256 colors for 8-bit. Think of it as paint-by-numbers: each pixel has a value, which tells the system which color it should be. By changing the list of colors, you can completely change the look of the image. (This is what Ferazel's Wand does with its enemies, like the "green goblins", "gray goblins," and "purple goblins". They only had to describe the image once, and just told the computer to draw it with a different group of colors.)

Next, there's 16 bit and 24 bit. These are "true color" formats. These images have three "channels" of data: "red", "green", and "blue." What this means is, out of the 16 bits describing a pixel in a 16-bit image, five are "red" bits, five are "blue" bits, and five are "green" bits. (Yes, that leaves one extra left-over bit. I'm not sure what they do with it. 🙂 ) Each five-bit color channel describes the amount of that color to add to that pixel, from none to lots. (Remember that red, blue, and green are the additive colors of light; full red plus full green plus full blue makes white; other colors are a mix of different levels of the three.). 24-bit color works the same as 16-bit, but instead of having 5 bits for each channel, it has 8. This additional space lets each channel have a more precise range of color, giving a more exact image.

The actual answer to your question:
Alpha channels come into play with 32-bit images. A 32-bit image is actually a 24-bit image with one more 8-bit channel: the "alpha" channel. While the Red, Green, and Blue channels describe the color of each pixel, the Alpha channel describes its transparency. 8 bits gives 256 levels of transparency, from fully opaque to fully transparent, with a full range of translucency in between. (By contrast, the old graphics format in Coldstone (which you can still use, if you wish) only has 1-bit transparency: either a pixel is completely transparent, or it's completely opaque.)

By using alpha masking, an image can have partially translucent edges which allow it to smoothly blend with its background. It also allows "see-through" windows which tint objects behind them, shadows which darken things underneath them, "light sources" which brighten the area around them, fog to obscure the view, translucent spell effects, ghostly enemies, and many other very cool things. 🙂

(Is that clearer?)
------------------
Back in my day, we didn't have any of this here UBB nonsense. It was DiscBoard or nothing, and we liked it!
"In all matters of opinion, our adversaries are insane." - Mark Twain
"The answer is yes or no , depending on the interpretation." - Albert Einstein

(This message has been edited by Glenn (edited 05-31-2001).)

Quote

Originally posted by Glenn:
**(I don't know how much tech talk you know, so pardon me if I talk down to you.)

By using alpha masking, an image can have partially translucent edges which allow it to smoothly blend with its background. It also allows "see-through" windows which tint objects behind them, shadows which darken things underneath them, "light sources" which brighten the area around them, fog to obscure the view, and many other very cool things. 🙂

**

haha you were talking "up" to me even in the background part.
I sense that these alpha thingies are gonna be nice for spell effects.

------------------
Evil is as Evil does

Quote

Originally posted by Lorenoth:
**haha you were talking "up" to me even in the background part.
I sense that these alpha thingies are gonna be nice for spell effects.
**

Yes, definitely. Spell effects should rarely be completely opaque; they will look much better when translucent and "ghostly".

And I'll go add a bit more background material to my previous post. Let me know if it helps. 🙂

------------------
Back in my day, we didn't have any of this here UBB nonsense. It was DiscBoard or nothing, and we liked it!
"In all matters of opinion, our adversaries are insane." - Mark Twain
"The answer is yes or no , depending on the interpretation." - Albert Einstein

Glenn wrote:

Quote

out of the 16 bits describing a pixel in a 16-bit image, five are "red" bits,
five are "blue" bits, and five are "green" bits. (Yes, that leaves one extra left-over bit. I'm not sure what they do with it. 🙂 )

On Macs, the last bit is a 1-bit alpha channel; i.e. the pixel can be entirely opaque or completely transparent (invisible). If the prior version of Coldstone supported 16-bit color natively, this explains the "on/off" transparency support you mentioned.

On PCs, "16-bit color" means 5 red bits, 6 green bits, and 5 blue bits.

------------------
James
dystopia, n.: A utopia, in practice.

(This message has been edited by Amorph (edited 06-01-2001).)

Quote

Originally posted by Amorph:
**Glenn wrote:

On PCs, "16-bit color" means 5 red bits, 6 green bits, and 5 blue bits.

**

Anticipating a future question, this is probably because the most data is typically present in the green area. Storing things like video data with green included in a nightmare for file size, so compression algorithms do anything they can to get around it. The JPEG algorithm doesn't even actually store green data, it stores the difference between it and red and blue. Smart.

------------------
We shall accept payment in a large briefcase. American dollar good for this purpose. LARGE briefcase, remember. -- forge