1Name 2 3 QCOM_alpha_test 4 5Name Strings 6 7 GL_QCOM_alpha_test 8 9Contact 10 11 Maurice Ribble (mribble 'at' qualcomm.com) 12 13Contributors 14 15 Benj Lipchak 16 Maurice Ribble 17 18Status 19 20 Complete. 21 22Version 23 24 Last Modified Date: October 11, 2010 25 Revision: #2 26 27Number 28 29 OpenGL ES Extension #89 30 31Dependencies 32 33 OpenGL ES 2.0 is required. 34 35 This extension is written against the OpenGL ES 2.0 specification. 36 37Overview 38 39 This extension reintroduces the alpha test per-fragment operation 40 from OpenGL ES 1.x. Some hardware has a dedicated unit capable of 41 performing this operation, and it can save ALU operations in the fragment 42 shader by avoiding the conditional discard. 43 44New Procedures and Functions 45 46 void AlphaFuncQCOM(enum func, clampf ref); 47 48New Tokens 49 50 Accepted by the <cap> parameter of Enable and Disable, and IsEnabled, and by 51 the <pname> parameter of GetBooleanv, GetIntegerv, and GetFloatv: 52 53 ALPHA_TEST_QCOM 0x0BC0 54 55 Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, and 56 GetFloatv: 57 58 ALPHA_TEST_FUNC_QCOM 0x0BC1 59 ALPHA_TEST_REF_QCOM 0x0BC2 60 61 Accepted by the <func> parameter of AlphaFuncQCOM: 62 63 NEVER 64 LESS 65 EQUAL 66 LEQUAL 67 GREATER 68 NOTEQUAL 69 GEQUAL 70 ALWAYS 71 72Additions to Chapter 4 of the OpenGL ES 2.0 Specification (Per-Fragment 73Operations) 74 75 Add a new section 4.1.4 - Alpha Test 76 77 The alpha test discards a fragment conditional on the outcome of a 78 comparison between the incoming fragment's alpha value and a constant 79 value. The comparison is enabled or disabled with the generic Enable 80 and Disable commands using the symbolic constant ALPHA_TEST. When 81 disabled, it is as if the comparison always passes. The test is 82 controlled with 83 84 void AlphaFuncQCOM(enum func, clampf ref); 85 86 <func> is a symbolic constant indicating the alpha test function; <ref> 87 is a reference value. <ref> is clamped to lie in [0,1], and then 88 converted to a fixed-point value according to the rules given for an A 89 component in section 2.12.8. For purposes of the alpha test, the 90 fragment's alpha value is also rounded to the nearest integer. The 91 possible constants specifying the test function are NEVER, ALWAYS, LESS, 92 LEQUAL, EQUAL, GEQUAL, GREATER, or NOTEQUAL, meaning pass the fragment 93 never, always, if the fragment's alpha value is less than, less than or 94 equal to, equal to, greater than or equal to, greater than, or not equal 95 to the reference value, respectively. 96 97 The required state consists of the floating-point reference value, an 98 eight-valued integer indicating the comparison function, and a bit 99 indicating if the comparison is enabled or disabled. The initial state 100 is for the reference value to be 0 and the function to be ALWAYS. 101 Initially, the alpha test is disabled. 102 103Errors 104 105 None 106 107New State 108 109 (table 6.17, Pixel Operations) add the following entries: 110 111 Initial 112 Get Value Type Get Command Value Description Section 113 ------------------- ---- ----------- ------ ------------------- ------- 114 ALPHA_TEST_QCOM B IsEnabled False Alpha test enabled 4.1.4 115 ALPHA_TEST_FUNC_QCOM Z8 GetIntegerv ALWAYS Alpha test function 4.1.4 116 ALPHA_TEST_REF_QCOM R+ GetFloatv 0 Alpha test reference 4.1.4 117 value 118 119Revision History 120 121 #01 11/04/2007 Benj Lipchak Created based on ES 1.1 spec language. 122 #02 10/11/2010 Maurice Ribble Updated to be QCOM extension and fixed 123 some wording. 124