• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    NV_conservative_raster_pre_snap_triangles
4
5Name Strings
6
7    GL_NV_conservative_raster_pre_snap_triangles
8
9Contact
10
11    Kedarnath Thangudu, NVIDIA Corporation (kthangudu 'at' nvidia.com)
12
13Contributors
14
15    Pat Brown, NVIDIA Corporation
16    David P Gould, NVIDIA Corporation
17    Eric Werness, NVIDIA Corporation
18
19Status
20
21    Shipping in NVIDIA release 367.XX drivers and up.
22
23Version
24
25    Last Modified Date:         February 11, 2016
26    Revision:                   1
27
28Number
29
30    OpenGL Extension #487
31    OpenGL ES Extension #262
32
33Dependencies
34
35    This extension is written against the NV_conservative_raster extension as
36    applied to OpenGL 4.3 specification (Compatibility Profile) but may be
37    used with the Core profile or OpenGL ES 2.0 or later.
38
39Overview
40
41    When CONSERVATIVE_RASTERIZATION_NV is enabled, the fragments generated for
42    a primitive are conservative with respect to the primitive after snapping
43    to sub-pixel grid.  This extension provides a new mode of rasterization
44    for triangles where the fragments generated are conservative with respect
45    to the primitive at infinite precision before vertex snapping.
46
47    When the conservative raster mode is set to CONSERVATIVE_RASTER_MODE_PRE_-
48    SNAP_TRIANGLES, triangles are rasterized more conservatively, and may
49    generate fragments not generated when the mode is CONSERVATIVE_RASTER_MODE_-
50    POST_SNAP (default). In particular it may generate fragments for pixels
51    covered by triangles with zero area, or for pixels that are adjacent to
52    but not covered by any triangle. This modified behavior may be useful in
53    compensating for rounding errors caused by snapping vertex positions to a
54    sub-pixel grid during rasterization.  It's possible that a non-degenerate
55    triangle becomes degenerate due to snapping.  It's additionally possible
56    that rounding errors in computing the position of a vertex or from
57    snapping may cause a primitive that would cover a pixel at infinite
58    precision to fail to cover the pixel post-snap.  Rasterizing such
59    primitives more conservatively may be useful for "binning" algorithms
60    described in NV_conservative_raster.
61
62
63New Procedures and Functions
64
65    void ConservativeRasterParameteriNV(enum pname, int param);
66
67New Tokens
68
69    Accepted by the <pname> parameter of ConservativeRasterParameteriNV:
70        CONSERVATIVE_RASTER_MODE_NV                     0x954D
71
72    Accepted by the <param> parameter of ConservativeRasterParameteriNV:
73        CONSERVATIVE_RASTER_MODE_POST_SNAP_NV           0x954E
74        CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV  0x954F
75
76    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
77    GetInteger64v, GetFloatv, and GetDoublev:
78
79        CONSERVATIVE_RASTER_MODE_NV                     0x954D
80
81
82Additions to Chapter 14 of the OpenGL 4.3 (Compatibility Profile) Specification
83(Fixed-Function Primitive Assembly and Rasterization)
84
85    Add the following paragraph to the end of the new subsection 14.6.X
86    "Conservative Rasterization" added by NV_conservative_raster
87
88    When CONSERVATIVE_RASTERIZATION_NV is enabled, the rasterization behavior
89    may be controlled by calling the following command
90
91        void ConservativeRasterParameteriNV(enum pname, int param);
92
93    with <pname> set to CONSERVATIVE_RASTER_MODE_NV. The <param> parameter
94    specifies the conservative raster mode to be used. If the mode is set to
95    CONSERVATIVE_RASTER_MODE_POST_SNAP_NV, the generated fragments are
96    conservative w.r.t the primitive after it is snapped to sub-pixel grid.
97    If the mode is set to CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV
98    the fragments generated for triangles will be conservative w.r.t the
99    triangle at infinite precision. Since non-degenerate triangles may become
100    degenerate due to vertex snapping, this mode will generate fragments for
101    zero area triangles that are otherwise culled when the mode is
102    CONSERVATIVE_RASTER_MODE_POST_SNAP_NV. This mode may also generate fragments for pixels that
103    are within half a sub-pixel distance away from a triangle's infinite
104    precision boundary.  The default mode is set to CONSERVATIVE_RASTER_MODE_-
105    POST_SNAP_NV.
106
107New State
108
109    Get Value                           Get Command    Type  Initial Value          Description             Sec.    Attribute
110    ---------                           -----------    ----  -------------          -----------             ----    ---------
111    CONSERVATIVE_RASTER_MODE_NV         GetIntegerv    E     CONSERVATIVE_RASTER_-  Control conservative    14.6.X  -
112                                                             MODE_POST_SNAP         rasterization mode.
113
114
115Additions to the AGL/GLX/WGL Specifications
116
117    None.
118
119GLX Protocol
120
121    None.
122
123Modifications to the OpenGL Shading Language Specification, Version 4.30
124
125    None.
126
127Errors
128
129    INVALID_ENUM is generated by ConservativeRasterParameteriNV if <pname> is
130    not CONSERVATIVE_RASTER_MODE_NV, or if <param> is not CONSERVATIVE_RASTER_-
131    MODE_POST_SNAP_NV or CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV.
132
133Issues
134
135    (1) How does this extension interact with snap control?
136
137    RESOLVED: When the conservative raster mode is set to CONSERVATIVE_RASTER_-
138    MODE_PRE_SNAP_TRIANGLES the generated fragments are conservative w.r.t
139    triangle at infinite precision i.e. before snapping to the sub-pixel grid.
140    To achieve this implementations may augment/dilate the triangle edges by
141    an amount (proportional to the sub-pixel precision) to compensate for
142    rounding errors caused by snapping vertex positions to a sub-pixel grid.
143    The amount of dilation is implementation dependent.
144
145    (2) Which way do the fragments generated for zero-area triangles face?
146
147    RESOLVED: Setting the conservative raster mode to CONSERVATIVE_RASTER_-
148    MODE_PRE_SNAP_TRIANGLES generates fragments for zero-area (degenerate)
149    triangles that are otherwise culled.  Since degenerate triangles don't have
150    a normal and therefore no theoretical facing, all the degenerate triangles
151    will be considered back-facing.  Degenerate triangles will be culled when
152    back-face culling is enabled in GL.
153
154    (3) How are the attributes computed for the fragments generated for zero-
155        area triangles?
156
157    RESOLVED: Since extrapolation/interpolation is not defined for degenerate
158    triangles, the provoking vertex's attributes and z are used for all the
159    fragments of such triangles.
160
161Revision History
162
163    Revision 1
164    - Internal revisions.
165