15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    ATI_separate_stencil
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_ATI_separate_stencil
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Benj Lipchak, AMD (benj.lipchak 'at' amd.com)
125bd8deadSopenharmony_ci    Evan Hart, NVIDIA (ehart 'at' nvidia.com)
135bd8deadSopenharmony_ci
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ciIP Status
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ci    None
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ciVersion
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ci    Date: 11/04/2006
225bd8deadSopenharmony_ci    Revision: 1.1
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ciNumber
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ci    289
275bd8deadSopenharmony_ci    
285bd8deadSopenharmony_ciDependencies
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ci    This spec is written against the 1.2.1 version of the GL spec.
315bd8deadSopenharmony_ci    This spec requires OpenGL 1.0
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ciOverview
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ci    This extension provides the ability to modify the stencil buffer
365bd8deadSopenharmony_ci    differently based on the facing direction of the primitive that
375bd8deadSopenharmony_ci    generated the fragment.
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ciIssues
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ci    
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ci
445bd8deadSopenharmony_ciNew Procedure and Functions
455bd8deadSopenharmony_ci
465bd8deadSopenharmony_ci    StencilOpSeparateATI( GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass)
475bd8deadSopenharmony_ci    StencilFuncSeparateATI( GLenum frontfunc, GLenum backfunc, GLint ref,
485bd8deadSopenharmony_ci                            GLuint mask)
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ciNew Tokens
515bd8deadSopenharmony_ci
525bd8deadSopenharmony_ci      
535bd8deadSopenharmony_ci    Accepted by the <fail>, <zfail>, and <zpass> parameters of
545bd8deadSopenharmony_ci    StencilOpSeparateATI:
555bd8deadSopenharmony_ci    
565bd8deadSopenharmony_ci      KEEP                                             0x1E00
575bd8deadSopenharmony_ci      ZERO                                             0x0000
585bd8deadSopenharmony_ci      REPLACE                                          0x1E01
595bd8deadSopenharmony_ci      INCR                                             0x1E02
605bd8deadSopenharmony_ci      DECR                                             0x1E03
615bd8deadSopenharmony_ci      INVERT                                           0x150A
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ci    Accepted by the <frontfunc> and <backfunc> parameters of
645bd8deadSopenharmony_ci    StencilFuncSeparateATI:
655bd8deadSopenharmony_ci
665bd8deadSopenharmony_ci      NEVER                                            0x0200
675bd8deadSopenharmony_ci      LESS                                             0x0201
685bd8deadSopenharmony_ci      LEQUAL                                           0x0203
695bd8deadSopenharmony_ci      GREATER                                          0x0204
705bd8deadSopenharmony_ci      GEQUAL                                           0x0206
715bd8deadSopenharmony_ci      EQUAL                                            0x0202
725bd8deadSopenharmony_ci      NOTEQUAL                                         0x0205
735bd8deadSopenharmony_ci      ALWAYS                                           0x0207
745bd8deadSopenharmony_ci
755bd8deadSopenharmony_ci    Accepted by the <face> parameter of StencilOpSeparateATI:
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ci      FRONT                                            0x0404
785bd8deadSopenharmony_ci      BACK                                             0x0405
795bd8deadSopenharmony_ci      FRONT_AND_BACK                                   0x0408
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetIntegerv:
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ci      STENCIL_BACK_FUNC_ATI                            0x8800
845bd8deadSopenharmony_ci      STENCIL_BACK_FAIL_ATI                            0x8801
855bd8deadSopenharmony_ci      STENCIL_BACK_PASS_DEPTH_FAIL_ATI                 0x8802
865bd8deadSopenharmony_ci      STENCIL_BACK_PASS_DEPTH_PASS_ATI                 0x8803
875bd8deadSopenharmony_ci   
885bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 1.2.1 Specification (Operation)
895bd8deadSopenharmony_ci
905bd8deadSopenharmony_ci    None
915bd8deadSopenharmony_ci
925bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 1.2.1 Specification (Rasterization)
935bd8deadSopenharmony_ci
945bd8deadSopenharmony_ci    Section 3.0
955bd8deadSopenharmony_ci
965bd8deadSopenharmony_ci    Change the second paragraph on page 57 to read:
975bd8deadSopenharmony_ci
985bd8deadSopenharmony_ci      "A grid square along with its parameters of assigned color, z
995bd8deadSopenharmony_ci      (depth), texture coordinates, and facing direction is called a
1005bd8deadSopenharmony_ci      fragment; the parameters are collectively dubbed the fragment's
1015bd8deadSopenharmony_ci      associated data. ..."
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ci    New section added after section 3.2
1045bd8deadSopenharmony_ci
1055bd8deadSopenharmony_ci      "Facing Direction
1065bd8deadSopenharmony_ci
1075bd8deadSopenharmony_ci      A fragment derives its facing direction from the primitive that
1085bd8deadSopenharmony_ci      generates the fragment. All fragments generated by primitves
1095bd8deadSopenharmony_ci      other than polygons, triangles, or quadrilaterals are considered
1105bd8deadSopenharmony_ci      to be front facing. For all other fragments the detemination is
1115bd8deadSopenharmony_ci      made by examining the sign of the area computed by equation 2.7
1125bd8deadSopenharmony_ci      of section 2.13.1 (including the possible reversal of this sign
1135bd8deadSopenharmony_ci      as indicated by the last call to FrontFace). If the sign is
1145bd8deadSopenharmony_ci      positive then the fragments are front facing; otherwise, they
1155bd8deadSopenharmony_ci      are back facing."
1165bd8deadSopenharmony_ci
1175bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 1.2.1 Specification (Per-Fragment Operations)
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ci    Section 4.1.4
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci    Change the first paragraph of section 4.1.4 to read:
1225bd8deadSopenharmony_ci
1235bd8deadSopenharmony_ci    "The stencil test conditionally discards a fragment based on a
1245bd8deadSopenharmony_ci    comparison between the value in the stencil buffer at location
1255bd8deadSopenharmony_ci    ( xw, yw) and a reference value. The test is controlled with
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ci      void StencilFunc( enum func, int ref, uint mask);
1285bd8deadSopenharmony_ci      void StencilFuncSeparateATI( enum frontfunc, enum backfunc,
1295bd8deadSopenharmony_ci                                   int ref, uint mask);
1305bd8deadSopenharmony_ci      void StencilOp( enum sfail, enum dpfail, enum dppass);
1315bd8deadSopenharmony_ci      void StencilOpSeparateATI( enum face, enum sfail, enum dpfail,
1325bd8deadSopenharmony_ci                                 enum dppass);
1335bd8deadSopenharmony_ci
1345bd8deadSopenharmony_ci    The test is enabled or disabled with the Enable and Disable
1355bd8deadSopenharmony_ci    commands, using the symbolic constant STENCIL_TEST. When disabled,
1365bd8deadSopenharmony_ci    the stencil test and the associated modifications are not made, 
1375bd8deadSopenharmony_ci    and the fragment is always passed. Additionally, the stencil test
1385bd8deadSopenharmony_ci    may treat front and back faces separately. The function
1395bd8deadSopenharmony_ci    StencilFuncSeparateATI sets each independently, while the function
1405bd8deadSopenharmony_ci    Stencil func sets both front and back to the same test."
1415bd8deadSopenharmony_ci
1425bd8deadSopenharmony_ci    Change the third paragraph of section 4.1.4 to read:
1435bd8deadSopenharmony_ci
1445bd8deadSopenharmony_ci    "StencilOp and StencilOpSeparateATI take three arguments that indicate
1455bd8deadSopenharmony_ci    what happens to the stored stencil value if this or certain
1465bd8deadSopenharmony_ci    subsequent tests fail or pass. StencilOp sets the ops for both front
1475bd8deadSopenharmony_ci    and back facing fragments, while StencilOpSeparateATI sets the ops for
1485bd8deadSopenharmony_ci    front facing, back facing, or both types of fragments based on the face
1495bd8deadSopenharmony_ci    parameter.  ..."
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 1.2.1 Specification (Special Functions)
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ci    None
1545bd8deadSopenharmony_ci
1555bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 1.2.1 Specification (State and State Requests) 
1565bd8deadSopenharmony_ci
1575bd8deadSopenharmony_ci    Additions to Table 6.15 Pixel Operations
1585bd8deadSopenharmony_ci
1595bd8deadSopenharmony_ci                                                         Initial
1605bd8deadSopenharmony_ci    Get Value                        Type    Get Cmnd    Value      Description  Sec.   Attribute
1615bd8deadSopenharmony_ci    ----------                       ------  ---------   ---------  ------------ -----  -------------
1625bd8deadSopenharmony_ci    STENCIL_BACK_FUNC_ATI             Z8     GetIntegerv  ALWAYS                 4.1.4  Stencil-buffer
1635bd8deadSopenharmony_ci    STENCIL_BACK_FAIL_ATI             Z6     GetIntegerv  KEEP                   4.1.4  Stencil-buffer
1645bd8deadSopenharmony_ci    STENCIL_BACK_PASS_DEPTH_FAIL_ATI  Z6     GetIntegerv  KEEP                   4.1.4  Stencil-buffer
1655bd8deadSopenharmony_ci    STENCIL_BACK_PASS_DEPTH_PASS_ATI  Z6     GetIntegerv  KEEP                   4.1.4  Stencil-buffer
1665bd8deadSopenharmony_ci    STENCIL_OP_SEPARATE_FACE_ATI      B      IsEnabled    FALSE                  4.1.4  Stencil-buffer
1675bd8deadSopenharmony_ci    
1685bd8deadSopenharmony_ci 
169