
Advanced Topics
Quadro SDI Output PG-03776-001_v06 | 64
Code Listing 45: Requesting a Multi-Sampled Pixel Format During
Pbuffer Creation
// Request multisampled pixel format.
int attribList = {
WGL_RED_BITS_ARB, 8,
WGL_GREEN_BITS_ARB, 8,
WGL_BLUE_BITS_ARB, 8,
WGL_ALPHA_BITS_ARB, 8,
WGL_STENCIL_BITS_ARB, 8,
WGL_DEPTH_BITS_ARB, 24,
WGL_SAMPLE_BUFFERS_ARB, GL_TRUE,
WGL_SAMPLES_ARB, num_samples,
WGL_DRAW_TO_PBUFFER_ARB, true,
WGL_BIND_TO_VIDEO_RGBA_NV, true,
0 };
wglChoosePixelFormat(hWindowDC, attribList, NULL, 1, &format,
&nformats);
.
.
.
// Enable multisampling.
if (gbFSAA) {
glEnable(GL_MULTISAMPLE_ARB);
}
In Code Listing 45, num_samples, can be specified as1, 2, 4, 8 or 16, the number of desired
samples per pixel. The greater the number, the more samples per pixel and improved
image quality. However, the application programmer should be aware, that increasing
the number of samples per pixel increases the video memory requirements of the
application and in some cases, especially in the cases of HD video formats, the capacity
of video memory may be exceeded. This may lead to reduced performance caused by
swapping of textures and other video data to main memory, or pbuffer creation may fail
due to lack of available video memory.
When the multi-sampled pbuffer is sent to the SDI video device with either
wglSendPbufferToVideoNV() or glxSendPbufferToVideoNV(), the driver will
automatically do the down sample blit prior to the SDI scanout.
For more information on multisampling, refer to the
GL_ARB_multisample extension
specification.
Comentários a estes Manuais