15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci NV_polygon_mode 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_NV_polygon_mode 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci James Helferty, NVIDIA Corporation (jhelferty 'at' nvidia.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciContributors 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci James Helferty, NVIDIA Corporation 165bd8deadSopenharmony_ci Daniel Koch, NVIDIA Corporation 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciStatus 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci Complete 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ciVersion 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci Last Modified Date: Sept 11, 2014 255bd8deadSopenharmony_ci Revision: 1 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ciNumber 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ci OpenGL ES Extension #238 305bd8deadSopenharmony_ci 315bd8deadSopenharmony_ciDependencies 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ci This extension is written against the OpenGL ES 3.1 (June 4, 2014) 345bd8deadSopenharmony_ci specification, but can apply to earlier versions. 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ci This extension trivially interacts with NV_draw_texture 375bd8deadSopenharmony_ci 385bd8deadSopenharmony_ciOverview 395bd8deadSopenharmony_ci 405bd8deadSopenharmony_ci This extension adds a PolygonModeNV entry point which can be used to change 415bd8deadSopenharmony_ci the polygon rasterization method. Using this extension, state consistent 425bd8deadSopenharmony_ci with rendering triangle primitives can trivially be toggled to render 435bd8deadSopenharmony_ci primitives as lines or points. In addition, independent enables are 445bd8deadSopenharmony_ci provided for polygon offset in conjunction with these new point and line 455bd8deadSopenharmony_ci polygon modes. 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ci This introduces a level of support for PolygonMode comparable with the 485bd8deadSopenharmony_ci OpenGL 4.3 core profile. 495bd8deadSopenharmony_ci 505bd8deadSopenharmony_ciNew Procedures and Functions 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ci void PolygonModeNV(enum face, enum mode); 535bd8deadSopenharmony_ci 545bd8deadSopenharmony_ciNew Tokens 555bd8deadSopenharmony_ci 565bd8deadSopenharmony_ci Accepted by the <pname> parameter to GetIntegerv: 575bd8deadSopenharmony_ci 585bd8deadSopenharmony_ci POLYGON_MODE_NV 0x0B40 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ci Accepted by the <pname> parameter to IsEnabled: 615bd8deadSopenharmony_ci 625bd8deadSopenharmony_ci POLYGON_OFFSET_POINT_NV 0x2A01 635bd8deadSopenharmony_ci POLYGON_OFFSET_LINE_NV 0x2A02 645bd8deadSopenharmony_ci 655bd8deadSopenharmony_ci Returned by GetIntegerv, GetFloatv, and GetInteger64v when <pname> is 665bd8deadSopenharmony_ci POLYGON_MODE_NV: 675bd8deadSopenharmony_ci 685bd8deadSopenharmony_ci POINT_NV 0x1B00 695bd8deadSopenharmony_ci LINE_NV 0x1B01 705bd8deadSopenharmony_ci FILL_NV 0x1B02 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ciAdditions to Chapter 13 of the OpenGL 3.1 Specification (Fixed-Function 735bd8deadSopenharmony_ciPrimitive Assembly and Rasterization) 745bd8deadSopenharmony_ci 755bd8deadSopenharmony_ci Insert new section 13.5.1pm, "Options Controlling Polygon Rasterization" 765bd8deadSopenharmony_ci between section 13.5.1 and 13.5.2: 775bd8deadSopenharmony_ci 785bd8deadSopenharmony_ci The interpretation of polygons for rasterization is controlled using 795bd8deadSopenharmony_ci 805bd8deadSopenharmony_ci void PolygonModeNV( enum face, enum mode ); 815bd8deadSopenharmony_ci 825bd8deadSopenharmony_ci <face> must be FRONT_AND_BACK, indicating that the rasterizing method 835bd8deadSopenharmony_ci described by <mode> replaces the rasterizing method for both front- and 845bd8deadSopenharmony_ci back-facing polygons. <mode> is one of the symbolic constants POINT_NV, 855bd8deadSopenharmony_ci LINE_NV, or FILL_NV. Calling PolygonModeNV with POINT_NV causes the 865bd8deadSopenharmony_ci vertices of a polygon to be treated, for rasterization purposes, as if they 875bd8deadSopenharmony_ci had been drawn with <mode> POINTS. LINE_NV causes edges to be rasterized as 885bd8deadSopenharmony_ci line segments. FILL_NV is the default mode of polygon rasterization, 895bd8deadSopenharmony_ci corresponding to the description in section 13.5.1. Note that these modes 905bd8deadSopenharmony_ci affect only the final rasterization of polygons: in particular, a polygon's 915bd8deadSopenharmony_ci vertices are lit, and the polygon is clipped and possibly culled before 925bd8deadSopenharmony_ci these modes are applied. 935bd8deadSopenharmony_ci 945bd8deadSopenharmony_ci Modify Section 13.5.2, "Depth Offset" as follows: 955bd8deadSopenharmony_ci 965bd8deadSopenharmony_ci Replace the second-last paragraph that begins "Boolean state value 975bd8deadSopenharmony_ci POLYGON_OFFSET_FILL determines whether <o> is applied during the 985bd8deadSopenharmony_ci rasterization of polygons..." with: 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci Boolean state values POLYGON_OFFSET_POINT_NV, POLYGON_OFFSET_LINE_NV, and 1015bd8deadSopenharmony_ci POLYGON_OFFSET_FILL determine whether <o> is applied during the 1025bd8deadSopenharmony_ci rasterization of polygons in POINT_NV, LINE_NV, and FILL_NV modes. These 1035bd8deadSopenharmony_ci boolean state values are enabled and disabled as argument values to the 1045bd8deadSopenharmony_ci commands Enable and Disable. If POLYGON_OFFSET_POINT_NV is enabled, <o> is 1055bd8deadSopenharmony_ci added to the depth value of each fragment produced by the rasterization of 1065bd8deadSopenharmony_ci a polygon in POINT_NV mode. Likewise, if POLYGON_OFFSET_LINE_NV or 1075bd8deadSopenharmony_ci POLYGON_OFFSET_FILL is enabled, <o> is added to the depth value of each 1085bd8deadSopenharmony_ci fragment produced by the rasterization of a polygon in LINE_NV or FILL_NV 1095bd8deadSopenharmony_ci modes, respectively. 1105bd8deadSopenharmony_ci 1115bd8deadSopenharmony_ci Modify Section 13.5.3, "Polygon Multisample Rasterization" as follows: 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ci Append the paragraph: 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ci The rasterization described above applies only to the FILL_NV state of 1165bd8deadSopenharmony_ci PolygonModeNV. For POINT_NV and LINE_NV, the rasterizations described in 1175bd8deadSopenharmony_ci sections 13.3.2 (Point Multisample Rasterization) and 13.4.4 (Line 1185bd8deadSopenharmony_ci Multisample Rasterization) apply. 1195bd8deadSopenharmony_ci 1205bd8deadSopenharmony_ci Modify Section 13.5.4 "Polygon Rasterization State" 1215bd8deadSopenharmony_ci 1225bd8deadSopenharmony_ci The state required for polygon rasterization consists of whether point, 1235bd8deadSopenharmony_ci line, and fill mode polygon offsets are enabled or disabled, and the factor 1245bd8deadSopenharmony_ci and bias values of the polygon offset equation. The initial polygon offset 1255bd8deadSopenharmony_ci factor and bias values are both 0; initially polygon offset is disabled for 1265bd8deadSopenharmony_ci all modes. The initial state for PolygonModeNV is FILL_NV. 1275bd8deadSopenharmony_ci 1285bd8deadSopenharmony_ciAdditions to Chapter 15 of the OpenGL 3.1 Specification (Writing Fragments and 1295bd8deadSopenharmony_ciSamples to the Framebuffer) 1305bd8deadSopenharmony_ci 1315bd8deadSopenharmony_ci Modify Section 15.1.4, "Stencil Test" as follows: 1325bd8deadSopenharmony_ci 1335bd8deadSopenharmony_ci Replace the third paragraph with: 1345bd8deadSopenharmony_ci 1355bd8deadSopenharmony_ci There are two sets of stencil-related state, the front stencil state set 1365bd8deadSopenharmony_ci and the back stencil state set. Stencil tests and writes use the front set 1375bd8deadSopenharmony_ci of stencil state when processing fragments rasterized from non-polygon 1385bd8deadSopenharmony_ci primitives (points and lines) and front-facing polygon primitives while the 1395bd8deadSopenharmony_ci back set of stencil state is used when processing fragments rasterized from 1405bd8deadSopenharmony_ci back-facing polygon primitives. For the purposes of stencil testing, a 1415bd8deadSopenharmony_ci primitive is still considered a polygon even if the polygon is to be 1425bd8deadSopenharmony_ci rasterized as points or lines due to the current polygon mode. Whether a 1435bd8deadSopenharmony_ci polygon is front- or back-facing is determined in the same manner used for 1445bd8deadSopenharmony_ci face culling (see section 13.5.1). 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ciInteractions with NV_draw_texture 1475bd8deadSopenharmony_ci 1485bd8deadSopenharmony_ci In NV_draw_texture, change references to PolygonMode to PolygonModeNV, and 1495bd8deadSopenharmony_ci disregard the interaction ignoring PolygonMode for ES. 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ciNew State 1525bd8deadSopenharmony_ci 1535bd8deadSopenharmony_ci Modify Table 20.6, Rasterization 1545bd8deadSopenharmony_ci 1555bd8deadSopenharmony_ci Add: 1565bd8deadSopenharmony_ci 1575bd8deadSopenharmony_ci Initial 1585bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. 1595bd8deadSopenharmony_ci ----------------------- ---- ----------- ------- --------------------------- ------ 1605bd8deadSopenharmony_ci POLYGON_MODE_NV E GetIntegerv FILL_NV Polygon rasterization mode 13.5.1pm 1615bd8deadSopenharmony_ci (front & back) 1625bd8deadSopenharmony_ci POLYGON_OFFSET_POINT_NV B IsEnabled FALSE Polygon offset enable for 13.5.2 1635bd8deadSopenharmony_ci POINT_NV mode rasterization 1645bd8deadSopenharmony_ci POLYGON_OFFSET_LINE_NV B IsEnabled FALSE Polygon offset enable for 13.5.2 1655bd8deadSopenharmony_ci LINE_NV mode rasterization 1665bd8deadSopenharmony_ci 1675bd8deadSopenharmony_ci Change description for POLYGON_OFFSET_FILL to "Polygon offset enable for 1685bd8deadSopenharmony_ci FILL_NV mode rasterization" 1695bd8deadSopenharmony_ci 1705bd8deadSopenharmony_ciErrors 1715bd8deadSopenharmony_ci 1725bd8deadSopenharmony_ci An INVALID_ENUM error is generated by PolygonModeNV if <face> is not 1735bd8deadSopenharmony_ci FRONT_AND_BACK. 1745bd8deadSopenharmony_ci 1755bd8deadSopenharmony_ci An INVALID_ENUM error is generated by PolygonModeNV if <mode> is not one of 1765bd8deadSopenharmony_ci POINT_NV, LINE_NV, or FILL_NV. 1775bd8deadSopenharmony_ci 1785bd8deadSopenharmony_ciIssues 1795bd8deadSopenharmony_ci 1805bd8deadSopenharmony_ci 1. How does PolygonModeNV interact with tessellation shaders? 1815bd8deadSopenharmony_ci 1825bd8deadSopenharmony_ci See Issue 29 of ARB_tessellation_shader. 1835bd8deadSopenharmony_ci 1845bd8deadSopenharmony_ciRevision History 1855bd8deadSopenharmony_ci 1865bd8deadSopenharmony_ci Rev. Date Author Changes 1875bd8deadSopenharmony_ci ---- -------- --------- ----------------------------------------- 1885bd8deadSopenharmony_ci 1 09/10/14 jhelferty Initial revision. 189