• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    NV_multisample_coverage
4
5Name Strings
6
7    GL_NV_multisample_coverage
8    GLX_NV_multisample_coverage
9    WGL_NV_multisample_coverage
10
11Contact
12
13    Mike Strauss (mstrauss 'at' nvidia.com)
14
15Status
16
17    Shipping in NVIDIA release 169.xx drivers (May 2008) for GeForce
18    8 and up
19
20Version
21
22    Revision:                   4
23    Last Modified Date:         March 7, 2013
24
25Number
26
27    393
28
29Dependencies
30
31    ARB_multisample is required.
32    Written using the language of the OpenGL 2.1 specification.
33    Written using the language of the GLX 1.4 specification.
34
35Overview
36
37    The ARB_multisample extension provides a mechanism for antialiasing
38    primitives.  This mechanism allows an application to request an
39    additional buffer, the multisample buffer, that is added to the
40    framebuffer.  An application can request the number of samples per
41    fragment that are stored in the multisample buffer.  Rendering
42    proceeds by writing color, depth, and stencil values for each
43    sample to the multisample buffer.  The results are automatically
44    resolved to a single displayable color each time a pixel is
45    updated.
46
47    Coverage Sample Anti-Aliasing (CSAA) is an extension to multisample
48    antialiasing.  The technique separates "samples" into two types of
49    samples.  "Color samples" are samples with color, depth, and
50    stencil information stored in the multisample buffer.  "Coverage
51    samples" include both color samples and additional samples that only
52    provide pixel coverage information.
53
54    This extension follows the example of the
55    NV_framebuffer_multisample_coverage extension, which adds CSAA
56    support for framebuffer objects.  The base description of
57    multisample rendering is written in terms of coverage samples and
58    color samples.  The windows system notion of "samples"
59    (SAMPLES_ARB) is layered on top of coverage and color samples.
60
61IP Status
62
63    None.
64
65New Procedures and Functions
66
67    None.
68
69New Tokens
70
71    Accepted by the <attribList> parameter of glXChooseVisual, and by
72    the <attrib> parameter of glXGetConfig, the <attrib_list> parameter
73    of glXChooseFBConfig, and the <attribute> parameter of
74    glXGetFBConfigAttrib:
75
76        GLX_COVERAGE_SAMPLES_NV              100001
77        GLX_COLOR_SAMPLES_NV                 0x20B3
78
79    Accepted by the <piAttributes> parameter of
80    wglGetPixelFormatAttribivEXT, wglGetPixelFormatAttribfvEXT, and
81    the <piAttribIList> and <pfAttribIList> of wglChoosePixelFormatEXT:
82
83        WGL_COVERAGE_SAMPLES_NV              0x2042
84        WGL_COLOR_SAMPLES_NV                 0x20B9
85
86    Accepted by the <pname> parameter of GetBooleanv, GetDoublev,
87    GetIntegerv, and GetFloatv:
88
89        COLOR_SAMPLES_NV                     0x8E20
90
91    (Note:  Earlier versions of this extension included a token
92     COVERAGE_SAMPLES_NV that was an alias for SAMPLES/SAMPLES_ARB.  This was
93     removed to avoid a name collision with a similar COVERAGE_SAMPLES_NV
94     token from the NV_coverage_sample extension to OpenGL ES.)
95
96Additions to Chapter 2 of the OpenGL 2.0 Specification (OpenGL Operation)
97
98    None.
99
100Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization)
101
102    Modify Section 3.2.1, Multisampling (p. 93).
103
104    (replace third and fourth paragraphs, p. 94)
105
106    During multisample rendering the contents of a pixel fragment are
107    changed in three ways.  First, each fragment includes a coverage
108    value with SAMPLES_ARB bits.  The value of SAMPLES_ARB is an
109    implementation-dependent constant, and is queried by calling
110    GetIntegerv with <pname> set to SAMPLES_ARB.
111
112    Second, each fragment includes SAMPLES_ARB coverage samples.  The
113    number of coverage samples includes both samples that indicate only
114    coverage information, as well as samples that include coverage,
115    color, depth, and texture coordinate information.  The location of
116    the coverage information only samples may be anywhere within the
117    pixel.  These samples may be used with an implementation-dependent
118    algorithm as additional weights when resolving the color values to a
119    single pixel color.
120
121    Third, each fragment includes COLOR_SAMPLES_NV depth values,
122    color values, and sets of texture coordinates instead of the
123    single depth value, color value, and set of texture coordinates
124    that are maintained in single-sample rendering mode.  These samples
125    are referred to as color samples, although they contain more than
126    color information.  COLOR_SAMPLES_NV is an implementation-dependent
127    constant, and is queried by calling GetIntegerv with <pname> set to
128    COLOR_SAMPLES_NV.  An implementation may choose to assign the same
129    color value and the same set of texture coordinates to more than
130    one sample.  The location for evaluating the color value and the
131    set of texture coordinates can be anywhere within the pixel
132    including the fragment center or any of the color sample locations.
133    The color value and the set of texture coordinates need not be
134    evaluated at the same location.  Each pixel fragment thus
135    consists of integer x and y grid coordinates, SAMPLES_ARB
136    samples, COLOR_SAMPLES_NV of which contain color and depth values,
137    COLOR_SAMPLES_NV sets of texture coordinates, and a coverage value
138    with a maximum of SAMPLES_ARB bits.
139
140    (modify seventh paragraph, p. 94)
141
142    If MULTISAMPLE is enabled, multisample rasterization of all
143    primitives differs substantially from single-sample rasterization.
144    It is understood that each pixel in the framebuffer has SAMPLES_ARB
145    locations associated with it.  Of these locations, COLOR_SAMPLES_NV
146    have associated color, depth, and texture coordinates.  The
147    remaining locations only supply additional pixel coverage
148    information.  These locations are exact positions, rather than
149    regions or areas, and each is referred to as a sample point.  The
150    sample points...
151
152Additions to Chapter 4 of the OpenGL 2.0 Specification (Per-Fragment
153Operations and the Frame Buffer)
154
155    Modify Section 4.1.11, Additional Multisample Fragment
156    Operations (p. 213).
157
158    (modify second paragraph, p. 213)
159
160    If MULTISAMPLE is enabled, and the value of SAMPLE_BUFFERS is one,
161    the alpha test, stencil test, depth test, blending, and dithering
162    operations are performed for each pixel color sample, rather than
163    just once for each fragment...
164
165    (modify third paragraph, p 215)
166
167    After all operations have been completed on the multisample...
168    The method of combination is not specified, though a simple average
169    computed independently for each color component is recommended when
170    the number of coverage samples and color samples are equal.
171
172
173Additions to Chapter 5 of the OpenGL 2.0 Specification (Special Functions)
174
175    None.
176
177Additions to Chapter 6 of the OpenGL 2.0 Specification (State and
178State Requests)
179
180
181
182Additions to Appendix A of the OpenGL 2.0 Specification (Invariance)
183
184    None.
185
186Additions to the GLX Specification
187
188    Modify Section 3.3.3 Configuration Management (p. 12)
189
190    (modify fourth paragraph, p. 12)
191
192    The attribute GLX_SAMPLE_BUFFERS indicates the number of multisample
193    buffers, which must be zero or one.  The attribute
194    GLX_COVERAGE_SAMPLES_NV gives the number of coverage samples per
195    pixel, and the attribute GLX_COLOR_SAMPLES_NV gives the number of
196    color samples per pixel;  if GLX_SAMPLE_BUFFERS is zero, then
197    GLX_COVERAGE_SAMPLES_NV and GLX_COLOR_SAMPLES_NV will also be zero.
198    If GLX_SAMPLE_BUFFERS is one, then the number of color, depth, and
199    stencil bits for each sample in the multisample buffer are
200    specified by the GLX_*_SIZE attributes.  GLX_SAMPLES is an alias for
201    GLX_COVERAGE_SAMPLES_NV.
202
203    (modify GLX_SAMPLES entry in Table 3.1: GLXFBConfig attributes,
204     p. 12)
205
206    Attribute               Type    Notes
207    ----------------------- ------- ------------------------------
208    GLX_COVERAGE_SAMPLES_NV integer no. coverage samples per pixel
209
210    (add a new entry to Table 3.1: GLXFBConfig attributes, p.12,
211     following the GLX_COVERAGE_SAMPLES_NV entry)
212
213    Attribute               Type    Notes
214    ----------------------- ------- ------------------------------
215    GLX_COLOR_SAMPLES_NV    integer no. color samples per pixel
216
217
218    (add a new following the discussion of GLX_TRASPARENT_TYPE,
219     p 18.)
220
221    If GLX_COVERAGE_SAMPLES_NV is in <attrib_list>, but
222    GLX_COLOR_SAMPLES_NV is not in <attrib_list> the selected
223    GLXFBConfigs must have the same number of color samples as
224    coverage samples.
225
226    (modify the GLX_SAMPLES entry in Table 3.4: Default values and
227    match criteria for GLXFBConfig attributes, p. 19)
228
229                                    Selection
230                                    and Sorting Sort
231    Attribute               Default Criteria    Priority
232    ----------------------- ------- ----------- --------
233    GLX_COVERAGE_SAMPLES_NV 0       SMALLER     7
234
235
236    (add a new entry to table 3.4:  Default values and match criteria
237    for GLXFBConfig attributes, p. 19, following the
238    GLX_COVERAGE_SAMPLES_NV entry.
239
240                                    Selection
241                                    and Sorting Sort
242    Attribute               Default Criteria    Priority
243    ----------------------- ------- ----------- --------
244    GLX_COLOR_SAMPLES_NV    0       SMALLER     8
245
246
247    (modify the GLX_DEPTH_SIZE, GLX_STENCIL_SIZE, GLX_ACCUM_*_SIZE,
248    and GLX_X_VISUAL_TYPE entries in table 3.4: Default values and
249    match criteria for GLXFBConfig attributes, p. 19, by incrementing
250    the value of Sort Priority for each)
251
252    (modify sixth paragraph, p. 20)
253
254    7. Smaller GLX_COVERAGE_SAMPLES_NV.
255
256    (add a new paragraph following the sixth paragraph, p. 20)
257
258    8. Smaller GLX_COLOR_SAMPLES_NV.
259
260    (modify paragraphs seven through ten, p. 20, by incrementing
261    the list number for each)
262
263    Modify Section 3.4.1 Using Visuals for Configuration Management
264
265    (modify the GLX_SAMPLES entry in Table 3.7: GLX attributes for
266    Visuals, p. 37)
267
268    Attribute                 Type     Notes
269    ------------------------- -------- --------------------------
270    GLX_COVERAGE_SAMPLES_NV   integer  number of coverage samples
271                                       per pixel.
272
273    (add a new entry to table 3.7: GLX attributes for Visuals, p.37,
274    following the GLX_COVERAGE_SAMPLES_NV entry)
275
276    Attribute                 Type     Notes
277    ------------------------- -------- --------------------------
278    GLX_COLOR_SAMPLES_NV      integer  number of color samples
279                                       per pixel.
280
281
282    (modify the GLX_SAMPLES entry in table 3.8: Defaults and selection
283    criteria used by glXChooseVisual, p.38)
284
285    Attribute                 Default Selection Criteria
286    ------------------------- ------- ------------------
287    GLX_COVERAGE_SAMPLES_NV      0    Smaller
288
289    (add a new entry to table 3.8: Defaults and selection criteria used
290    by glXChooseVisual, p.38, following the GLX_COVERAGE_SAMPLES_NV
291    entry)
292
293    Attribute                 Default Selection Criteria
294    ------------------------- ------- ------------------
295    GLX_COLOR_SAMPLES_NV         0    Smaller
296
297
298GLX Protocol
299
300    None.
301
302Additions to the WGL Specification
303
304    Modify additions from ARB_multisample
305
306    (modify first and second paragraphs)
307
308    The parameter WGL_SAMPLE_BUFFERS_ARB is added to
309    wglGetPixelFormatAttrib*v. When queried, by calling
310    wglGetPixelFormatAttrib*v with <piAttributes> set to
311    WGL_SAMPLE_BUFFERS_ARB, it returns the number of multisample
312    buffers included in the pixel format.  For a normal pixel format,
313    the return value is zero.  A return value of one indicates that a
314    single multisample buffer is available.  The number of coverage
315    samples per pixel is queried by calling wglGetPixelFormatAttrib*v
316    with <piAttributes> set to WGL_COVERAGE_SAMPLES_NV.  The number of
317    color samples per pixel is queried by calling
318    wglGetPixelFormatAttrib*v with <piAttributes> set to
319    WGL_COLOR_SAMPLES_NV. It is understood that the number of color,
320    depth, and stencil bits per sample in the multisample buffer are as
321    specified by the WGL_*_SIZE parameters.  It is also understood that
322    there are no single-sample depth or stencil buffers associated with
323    this pixel format -- the only depth and stencil buffers are those
324    in the multisample buffer.  WGL_COVERAGE_SAMPLES_NV and
325    WGL_COLOR_SAMPLES_NV are zero if WGL_SAMPLES_BUFFERS_ARB is zero.
326    WGL_SAMPLES_ARB is an alias for WGL_COVERAGE_SAMPLES_NV.
327
328    wglChoosePixelFormatARB accepts WGL_SAMPLE_BUFFERS_ARB in
329    <piAttribIList> and <pfAttribIList> with the corresponding value
330    set to the minimum number of multisample buffers that can be
331    accepted.  Pixel formats with the smallest number of multisample
332    buffers that meets or exceeds the specified minimum number are
333    preferred.  Currently operations with more than one multisample
334    buffer are undefined, so the returned value will be either zero or
335    one.
336
337    (add a new paragraph, missing from ARB_multisample, following the
338     second paragraph)
339
340    wglChoosePixelFormatARB accepts WGL_COVERAGE_SAMPLES_NV in
341    <piAttribIList> and  <pfAttibIList> with the corresponding value
342    set to the requested number of coverage samples for the multisample
343    buffer.  wglChoosePixelFormatARB accepts WGL_COLOR_SAMPLES_NV in
344    <piAttribIList> and <pfAttribIList> with the corresponding value
345    set to the requested number of color samples for the multisample
346    buffer.  A pixel format with differing numbers of coverage and
347    color samples may only be chosen when WGL_COLOR_SAMPLES_NV is
348    specified.
349
350
351Errors
352
353    None.
354
355New State
356
357
358New Implementation Dependent State
359
360                                          Minimum
361    Get Value            Type Get Command Value   Description                Sec.
362    -------------------- ---- ----------- ------- -------------------------- -----
363    SAMPLES_ARB          Z+   GetIntegerv 0       Number of coverage samples 3.2.1
364                                                  (state already in ARB_multisample,
365                                                   just defined to be coverage samples)
366    COLOR_SAMPLES_NV     Z+   GetIntegerv 0       Number of color samples    3.2.1
367
368Issues
369
370    1)  How do we provide backward compatibility for glXChooseFBConfig
371        and wglChoosePixelFormatARB if COVERAGE_SAMPLES_NV aliases to
372        SAMPLES_ARB?
373
374        RESOLVED:  Traditional multisample antialiasing can be
375        be described as CSAA where the number of coverage and color
376        samples are the same (all samples provide coverage, color,
377        depth, and stencil information).  Existing applications and
378        applications that do not wish to use this extension will use
379        SAMPLES_ARB when choosing a multisample GLXFBConfig or pixel
380        format.  In this case, glXChooseFBConfig and
381        wglChoosePixelFormatARB should never return a CSAA visual or
382        pixel format.  This is enforced in the spec by requiring the
383        presence of COLOR_SAMPLES_NV in the attribute list in order to
384        return a CSAA GLXFBConfig or pixel format.
385
386        (NOTE:  The token COVERAGE_SAMPLES_NV was removed in version 4
387         of the extension, but its value was always indistinguishable
388         from SAMPLES_ARB.)
389
390    2)  How do we provide backward compatibility for
391        glXGetFBConfigAttrib and wglGetPixelFormatAttrib*v if
392        COVERAGE_SAMPLES_NV aliases to SAMPLES_ARB?
393
394        RESOLVED: The glXGetFBConfigAttrib and
395        wglGetPixelFormatAttrib*v routines provide a mechanism for
396        applications to query properties of a GLXFBConfig or pixel
397        format.  This is useful for obtaining additional information
398        about a GLXFBConfig or pixel format after choosing one with the
399        appropriate routine.  An application can also use these
400        routines to apply custom GLXFBConfig/pixel format selection
401        logic when presented with a set of GLXFBConfigs or pixel
402        formats.
403
404        In the latter case, existing applications and future
405        applications that do not use this extension may accidentally
406        select a CSAA GLXFBConfig or pixel format because they only
407        look at SAMPLES_ARB, which aliases to COVERAGE_SAMPLES_NV.
408        This problem is not unique to CSAA GLXFBConfigs and pixel
409        formats.  An application can run into a problem selecting the
410        wrong GLXFBConfig or pixel format any time a new GLXFBConfig or
411        pixel format attribute is added that differs from the old
412        default.  The GLX specification provides GLXFBConfig sorting
413        guidelines to aid in working around this problem.  For WGL,
414        vendors are encouraged to order their visuals and pixel formats
415        in such a way that gives preference to old formats.  With
416        regards to CSAA, it is recommended that vendors list traditional
417        multisample pixel formats first, and CSAA pixel formats later.
418        The assumption being that applications will tend to choose the
419        first pixel format that meets the criteria.
420
421        (NOTE:  The token COVERAGE_SAMPLES_NV was removed in version 4
422         of the extension, but its value was always indistinguishable
423         from SAMPLES_ARB.)
424
425    3)  The NV_framebuffer_multisample_coverage extension supplies
426        specific rules with regards to how the requested number of
427        coverage and color samples are rounded to an implementation
428        supported value.  Should this extension provide similar rules?
429
430        RESOLVED.  The NV_framebuffer_multisample_coverage extension
431        is built on top of EXT_framebuffer_multisample, which provides
432        explicit rules for rounding the number of requested samples.
433        Specifically, the spec says to round the number of requested
434        samples up to the next implementation supported value.
435        NV_framebuffer_multisample_coverage says that the number of
436        coverage samples is rounded to the next highest implementation
437        supported value.  The number of color samples is rounded up to
438        the next highest implementation supported value given the
439        chosen number of coverage samples.
440
441        Choosing WGL pixel formats has always been a flexible
442        and fuzzy process.  On the other hand, the GLX specification
443        provides explicit rules for sorting and choosing GLXFBConfigs.
444        Language has been added to the GLX spec to sort first on
445        coverage samples, and then on color samples.  This has a
446        similar effect as the rules given in
447        NV_framebuffer_multisample_coverage as long as both
448        COVERAGE_SAMPLES_NV and COLOR_SAMPLES_NV are specified.  For
449        WGL pixel format selection, the implementation is free to
450        sort in whatever way it wishes.  Although it is recommended
451        that sorting be done in a way that is compatible with
452        NV_framebuffer_mulitsample_coverage.
453
454Revision History
455
456        Revision 1, 6/22/2007, mstrauss:  Initial version
457        Revision 2, 6/23/2007, mstrauss:  Removed GLX visual language.
458                                          Added GLXFBconfig language.
459        Revision 3, 4/20/2009, jajones:   Filled in GLX token values.
460                                          Restored GLX 1.2 compatibility
461                                          table entries.
462        Revision 4, 3/7/2013, pbrown:     Removed the OpenGL API token
463                                          COVERAGE_SAMPLES_NV, which was
464                                          just an alias for SAMPLES_ARB.
465
466
467