1Name 2 3 ATI_pn_triangles 4 5Name Strings 6 7 GL_ATI_pn_triangles 8 9Contact 10 11 Dan Ginsburg, AMD (dan.ginsburg 'at' amd.com) 12 Alex Vlachos 13 14Version 15 16 Last Modified Date: November 4, 2006 17 Revision: 1.2 18 19Number 20 21 246 22 23Dependencies 24 25 ARB_vertex_program and EXT_vertex_shader affect the definition of 26 this extension. 27 28Overview 29 30 ATI_pn_triangles provides a path for enabling the GL to internally 31 tessellate input geometry into curved patches. The extension allows the 32 user to tune the amount of tessellation to be performed on each triangle as 33 a global state value. The intent of PN Triangle tessellation is 34 typically to produce geometry with a smoother silhouette and more organic 35 shape. 36 37 The tessellated patch will replace the triangles input into the GL. 38 The GL will generate new vertices in object-space, prior to geometry 39 transformation. Only the vertices and normals are required to produce 40 proper results, and the rest of the information per vertex is interpolated 41 linearly across the patch. 42 43Issues 44 45 (1) Should this extension mandate the algorithm used to perform 46 tessellation? 47 48 RESOLVED: Yes, both for performance and so that the resultant 49 geometry is consistent across implementations. 50 51 (2) What geometry modes will be supported for tessellation besides 52 TRIANGLE based primitives? 53 54 RESOLVED: None, only triangle based primitives: triangles, fans, 55 and strips. 56 57 (3) How does this extension interact with the EXT_vertex_shader and 58 ARB_vertex_program programmable vertex shader extensions? 59 60 RESOLVED: The PN Triangle tessellation algorithm requires the 61 presence of both vertex position and normal. Therefore, if an 62 application enables PN Triangle tessellation and has a programmable 63 vertex shader enabled, that shader should export the fixed-function 64 equivalent of position and normal. If the shader does not export 65 either the position or normal, then the results of PN Triangle 66 tessellation are undefined. 67 68 69New Procedure and Functions 70 71 PNTrianglesiATI(enum pname, int param) 72 PNTrianglesfATI(enum pname, float param) 73 74 75New Tokens 76 77 Accepted by the <target> Enable, Disable, and IsEnabled: 78 79 PN_TRIANGLES_ATI 0x87F0 80 81 Accepted by the <value> parameter of GetBooleanv, GetIntegerv, 82 GetFloatv, and GetDoublev: 83 84 MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 85 86 Accepted by the <pname> parameter of PNTriangles[if]ATI, 87 GetBooleanv, GetDoublev, GetFloatv, and GetIntegerv: 88 89 PN_TRIANGLES_POINT_MODE_ATI 0x87F2 90 PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 91 PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 92 93 Accepted by the <param> parameter of PNTriangles[if]ATI 94 when <pname> is PN_TRIANGLES_POINT_MODE_ATI: 95 96 PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 97 PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 98 99 Accepted by the <param> parameter of PNTriangles[if]ATI 100 when <pname> is PN_TRIANGLES_NORMAL_MODE_ATI: 101 102 PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 103 PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 104 105 106Additions to Chapter 2 of the OpenGL 1.2.1 Specification (Operation) 107 108 None 109 110Additions to Chapter 3 if the OpenGL 1.2.1 Specification (Rasterization): 111 112 Add a new section "PN Triangles" after "3.10 Fog" and before "3.11 113 Antialiasing Application": 114 115 "3.11 PN Triangles 116 117 When PN Triangle generation is enabled, each triangle-based geometric 118 primitive is replaced with a new curved surface using the primitive 119 vertices as control points. The intent of PN Triangles 120 are to take a set of triangle-based geometry and algorithmically 121 tessellate it into a more organic shape with a smoother silhouette. 122 The new surface can either linearly or quadratically interpolate the 123 normals across the patch. The vertices can be either linearly or 124 cubically interpolated across the patch. Linear interpolation 125 of the points would be useful for getting more sample points for 126 lighting on the same geometric shape. All other vertex information 127 (colors, texture coordinates, fog coordinates, and vertex weights) are 128 interpolated linearly across the patch. 129 130 PN Triangle generation is enabled and disabled with the Enable and Disable 131 commands using the symbolic constant PN_TRIANGLES_ATI. The level of 132 tessellation to be performed is specified as the number of evaluation 133 points on each edge. Specifying 0 would use the original triangle, 1 134 would generate one new point on each edge of the triangle, and so forth. 135 136 The tessellation level and normal generation mode are specified with: 137 138 void PNTriangles{if}ATI(enum pname, T param) 139 140 If <pname> is PN_TRIANGLES_NORMAL_MODE_ATI then <param> must be one of the 141 symbolic constants PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI or 142 PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI which will select linear or 143 quadratic normal interpolation respectively. If <pname> is 144 PN_TRIANGLES_POINT_MODE_ATI then <param> must be one of the symbolic 145 constants PN_TRIANGLES_POINT_MODE_LINEAR_ATI or 146 PN_TRIANGLES_POINT_MODE_CUBIC_ATI which will select linear or cubic 147 interpolation respectively. If <pname> is 148 PN_TRIANGLES_TESSELATION_LEVEL_ATI then <param> should be a value 149 specifying the number of evaluation points on each edge. This value must be 150 greater than 0 and less than or equal to the value given by 151 MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI. An INVALID_VALUE error will be 152 generated if the value for <param> is less than zero or greater than the max 153 value. 154 155 If either VERTEX_SHADER_EXT or VERTEX_SHADER_ARB are enabled, then the 156 shader specified by the application must export both the position and normal 157 in order for PN triangle tessellation to work correctly. If either the 158 position or normal are not exported by the vertex shader then the result of 159 PN triangle tessellation is undefined." 160 161Additions to Chapter 4: 162 163 None 164 165Additions to Chapter 5: 166 167 None 168 169Additions to Chapter 6: 170 171 None 172 173Additions to the GLX Specification 174 175 None 176 177GLX Protocol 178 179 None 180 181Errors 182 183 INVALID_VALUE is generated if the <param> parameter for 184 PNTriangles{if}ATI is less than zero or greater than 185 the value given for MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 186 when <pname> is PN_TRIANGLES_TESSELATION_LEVEL_ATI. 187 188New State 189 190 New table after Table 6.6 Fog: 191 192 "Table 6.7 PN Triangles: 193 194Get Value Get Command Type Initial Value Attribute 195--------- ----------- ---- ------------- --------- 196PN_TRIANGLES_ATI IsEnabled B False PN Triangles/enable 197PN_TRIANGLES_NORMAL_MODE_ATI GetIntegerv Z2 PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI PN Triangles 198PN_TRIANGLES_POINT_MODE_ATI GetIntegerv Z2 PN_TRIANGLES_POINT_MODE_CUBIC_ATI PN Triangles 199PN_TRIANGLES_TESSELATION_LEVEL_ATI GetIntegerv Z+ 1 PN Triangles 200 201 202 Modified state in Table 6.25: 203 204Get Value Get Command Type Minimum Value Attribute 205--------- ----------- ---- ------------ --------- 206MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI GetIntegerv Z+ 1 - 207" 208 209 210New Implementation Dependent State 211 212 None 213 214Revision History 215 216 Date: 11/4/2006 217 Revision: 1.2 218 - Updated contact info after ATI/AMD merger. 219 220 Date: 11/11/2002 221 Revision: 1.1 222 223 - Added issue and documentation that describes interaction between 224 PN Triangles and vertex shaders. 225 226 Date: 8/21/2001 227 Revision: 1.0 228 229 - First published version 230 231 232 233