RE: [Algorithms] Alpha Channel
Brought to you by:
vexxed72
From: Discoe, B. <ben...@in...> - 2000-08-27 03:32:52
|
Pai-Hung, It is indeed a difficult process to generate a good 8-bit alpha channel for a 32-bit texture. For nearly any photographic data source, it cannot be done procedurally. It requires a human artist to produce usable results. Here is a tutorial i wrote on how to produce the alpha using PhotoShop: http://vterrain.org/Plants/Create/ Part of why it is so difficult is that along the perimeter of the shape (e.g. tree) there are pixels with alpha between 0 and 1, so bits of the surrounding (non-tree) texel color will appear on the output. This is very difficult to fix. No matter what color you choose (black is a common choice), you will get a "fringe" of that color around the resulting texture billboard, unless you hand-edit on a nearly pixel basis. One popular simplification is to use single-bit alpha (alpha testing, not alpha blending). The advantages are that the art task is easier, and you don't have to draw the texture billboards in back-to-front order, which can be a significant performance hit since it is faster to sort by texture to avoid context switches. The drawbacks are harsh, unnatural aliased edges for your texture billboards. In the VTP software, we currently use 8-bit alpha blending for quality, but i'm considering switching to alpha-testing for speed. A forest may be more convincing with 2-3x as many trees even if the trees have jittery edges. Good luck, Ben http://vterrain.org/ > -----Original Message----- > From: Pai-Hung Chen [mailto:pa...@ac...] > Sent: Saturday, August 26, 2000 1:09 PM > To: gda...@li... > Subject: [Algorithms] Alpha Channel > > Hi, > > I want to use billboard in my program but cannot find a good > way to create 32-bit bitmap with alpha channel of appropriate > values. Basically I want to create a bitmap of tree with leaves > in various green colors (with alpha = 255) and all non-green > colors transparent (alpha = 0) so that I can use it > as the texture for my billboarded trees. |