VolumeRendering

Open GL Transparency

OpenGL Graphic Primitives | | OpenGL ModelView Transformations

Geometric primitives can be semi-transparent by defining a fourth alpha channel of the color:

glColor4f(r,g,b, alpha);

A red color with 10% transparency:

glColor4f(1,0,0, 0.9f);
$alpha = Opacity$
$Opacity = 1 - Transparency$

Composition of multiple primitives with $alpha\ne1$ needs to be done with blending enabled in back to front fashion:

glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);

If blending is not done back to front, colors will be awkward:

Left: Ok - from back to front, Right: Wrong - from front to back

OpenGL Graphic Primitives | | OpenGL ModelView Transformations

Options: