Transparency

Transparency

Triangles can be made transparent... this can be used to simulate glass and other transparent materials such as water.

RGBA

In 3D graphics, transparency is called "alpha" (short for "alpha transparency") and the value is defined as a component of the colour, defined as (r,g,b,a) which are "red, green, blue and alpha" values. So the RGB componenst are color and the A is the transparency value. Each of these RGBA values are usually in the range from 0.0 to 1.0.

32bit Color

RGBA is often called "32bit Color" because each component is 8bits and (8 x 4) = 32 bits. An 8bit value can have 256 possible values so the range of colors is (R x G x B) or (256 x 256 x 256) = 16,777,216 or 16 million colors. The term "24bit Color" refers to the RGB components only whereas "32bit Color" includes the A component therefore 24 and 32bit Color both have the same range of possible colors at 16 million... this is because the additional 8bits relate only to transparency and not color.

Depth Ordering

For transparent objects to look correct they must be drawn in depth order. That is, draw the most distant object first, moving forward until you draw the closest object last.

This is because we "blend" the background objects that are behind the transparent surface with the transparent surface in front. For example, the following Cube has transparency and no specific drawing order... the result is that we do not see some surfaces at the back side of the cube.

Cube

If we draw each side starting with the furthest away and ending with the closest side drawn last, the result is better because we can now see all 6 sides of the cube.

Cube with Depth Ordering

Transparency per Point

We know a triangle may have a color for each point or "vertex". In the same way we can assign a transparency value not just for the whole triangle but for each point of the triangle. The following cube has transparent values on some of the points.

Cube with some Transparent Points

Texture Invisible Color

We know Textures can be used to paint triangles with color using RGB values in the image. We can also assign a color value (e.g: black) in a Texture to be a transparency pixel. The following example shows a cube with a texture that uses black as an invisible color.

Texture Invisible Color

Texture Alpha Image

We can also have an image with RGBA values that includes transparency information for every pixel in the image. The following example shows a cube with colored triangles, a texture image, and an "alpha" image. The result is "painted transparency" just like a texture applies color.

Color + Texture + Transparency = Result

Texture Alpha Image

3D Kit Builder

In the image below we have transparency applied to the front windscreen so you can see inside the 3D model of the Monster Truck.

Triangles with transparency

To show this in our example 3D Kit Builder model use the following Display options:

Display EffectSetting

Wireframe

OFF

Texture (Paint)

ON

Transparency

ON

If we then "turn off" transparency we can no longer see through the windscreen on the Monster Truck.

Triangles with no transparency

Display EffectSetting

Transparency

OFF

Further Reading



Transparency
(graphic)


32bit Color

Next Topic



Lighting


Mirroring