next up previous contents
Next: 11 Natural Phenomena Up: 10 Transparency Previous: 10.4 Using the Alpha

10.5 Using Multisampling

On systems which support the multisample extension (SGIS_multisample), the per-fragment sample mask may be used to change the transparency of an object.

One technique involves GL_SAMPLE_ALPHA_TO_MASK_SGIS. If transparent objects in a scene do not overlap, GL_SAMPLE_ALPHA_TO_MASK_SGIS may be used. This parameter causes the alpha of a fragment to be mapped to a sample mask which will be bitwise anded with the fragment's mask. The value of the generated sample mask is implementation-dependent and is a function of the pixel location and the fragment's alpha value. If two objects were drawn at the same location with the same transparency, the sample mask would be the same and the same samples would be touched. If two objects were drawn at the same location with different transparencies, results may or may not be acceptable.

The simplest technique is to use the glSampleMaskSGIS() command to set the value of the GL_SAMPLE_MASK_SGIS. This value is used to generate a temporary mask which is bitwise anded with the fragment's mask. Again, results may not be correct if transparent objects overlap.

Currently, SGIS_multisample is supported by Silicon Graphics and Hewlett Packard.



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