next up previous contents
Next: 10.2 Alpha Blending Up: 10 Transparency Previous: 10 Transparency

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 be rasterized. The percentage of bits in the bitmask which are 1 is equivalent to the transparency of the object.[14].

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 x and y 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 0, the fragment is rejected. If the bit is 1, rasterization continues.

Since the lookup into the stipple pattern takes place in screen space, a different pattern must be used for objects which overlap, even if the transparency of the objects is the same. Were the same stipple pattern to be used, the same pixels in the frame buffer would be drawn for each object. Of the transparent objects, only the last (or the closest, if depth buffering were 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.



David Blythe
Thu Jul 17 21:24:28 PDT 1997