void glSamplePatternEXT(GLenum pattern)
pattern | A symbolic constant that indicates the sampling pattern to be used when multisampling is enabled. The allowable values are GL_1PASS_EXT, GL_2PASS_0_EXT, GL_2PASS_1_EXT, GL_4PASS_0_EXT, GL_4PASS_1_EXT, GL_4PASS_2_EXT, and GL_4PASS_3_EXT. |
The technique is to sample all primitives multiple times at each pixel. The color sample values are resolved to a single, displayable color each time a pixel is updated, so the antialiasing appears to be automatic at the application level. Because each sample includes depth and stencil information, the depth and stencil functions perform equivalently to the single-sample mode.
An additional buffer, called the multisample buffer, is required. Pixel sample values, including color, depth, and stencil values, are stored in this buffer. When the frame buffer includes a multisample buffer, it does not also include separate depth or stencil buffers, even if the multisample buffer does not store depth or stencil values. Color buffers (left/right, front/back, and aux) do coexist with the multisample buffer, however.
The locations of the sample points are relatively static. They change only when glSamplePatternEXT is called, and are a repeatable function of the parameter pattern. The default pattern GL_1PASS_EXT is designed to produce a well antialiased result in a single rendering pass. Patterns GL_2PASS_0_EXT and GL_2PASS_1_EXT together specify twice the number of sample points per pixel. It is intended that a scene be completely rendered using pattern GL_2PASS_0_EXT, then completely rendered again using GL_2PASS_1_EXT. When these two images are averaged using the accumulation buffer, the result is as if a single pass had been rendered with a pattern of twice the number of sample points. Patterns GL_4PASS_0_EXT, GL_4PASS_1_EXT, GL_4PASS_2_EXT, and GL_4PASS_3_EXT together define a pattern of four times the number of sample points. They can be used to accumulate an image after four complete rendering passes.
Some sample locations may lie outside the unit square that is considered to bound the pixel.