12.1 Screen-Door Transparency

One of the simpler transparency techniques is known as screen-door transparency. Screen-door transparency uses a bit mask to
cause certain pixels not to be rasterized. The percentage of bits in the
bitmask which are set to is equivalent to the transparency of the
object [30].

In OpenGL, screen-door transparency is implemented using polygon
stippling. The command glPolygonStipple() defines a 32x32 polygon
stipple pattern. When stippling is enabled (using
glEnableGL_ POLYGON_STIPPLE(GL_ POLYGON_STIPPLE)) the low-order and bits
of the screen coordinates of each fragment are used to index into the
stipple pattern. If the corresponding bit of the stipple pattern is
, the fragment is rejected. If the bit is , rasterization
continues.

Since the lookup into the stipple pattern takes place in screen space,
a different pattern should be used for objects which overlap, even if
the transparency of the objects is the same. If the same stipple
pattern is used, the same pixels in the framebuffer would be drawn for
each object. Of the transparent objects, only the last (or the closest,
if depth buffering is enabled) would be visible.

The biggest advantage of screen-door transparency is that the objects
do not need to be sorted. Also, rasterization may be faster on some
systems using the screen-door technique than using other techniques
such as alpha blending. Since the screen-door technique operates on a
per-fragment basis, the results will not look as smooth as if another
technique had been used. However, patterns that repeat on a 2x2 grid
are the smoothest and a 50% transparent ``checkerboard'' pattern
looks quite smooth on most systems.