1Name 2 3 OES_blend_subtract 4 5Name Strings 6 7 GL_OES_blend_subtract 8 9Contact 10 11 Benj Lipchak, Apple (lipchak 'at' apple.com) 12 13Notice 14 15 Copyright (c) 2009-2013 The Khronos Group Inc. Copyright terms at 16 http://www.khronos.org/registry/speccopyright.html 17 18Specification Update Policy 19 20 Khronos-approved extension specifications are updated in response to 21 issues and bugs prioritized by the Khronos OpenGL ES Working Group. For 22 extensions which have been promoted to a core Specification, fixes will 23 first appear in the latest version of that core Specification, and will 24 eventually be backported to the extension document. This policy is 25 described in more detail at 26 https://www.khronos.org/registry/OpenGL/docs/update_policy.php 27 28Status 29 30 Ratified by the Khronos BOP, July 31, 2009. 31 32Version 33 34 Date: 05/19/2009 Version 1.0 35 36Number 37 38 OpenGL ES Extension #3 39 40Dependencies 41 42 Written based on the wording of the OpenGL ES 1.1 specification. 43 44Overview 45 46 Blending capability is extended by respecifying the entire blend 47 equation. While this document defines only two new equations, the 48 BlendEquationOES procedure that it defines will be used by subsequent 49 extensions to define additional blending equations. 50 51 In addition to the default blending equation, two new blending equations 52 are specified. These equations are similar to the default blending 53 equation, but produce the difference of its left and right hand sides, 54 rather than the sum. Image differences are useful in many image 55 processing applications. 56 57New Procedures and Functions 58 59 void BlendEquationOES(enum mode); 60 61New Tokens 62 63 Accepted by the <mode> parameter of BlendEquationOES: 64 65 FUNC_ADD_OES 0x8006 66 FUNC_SUBTRACT_OES 0x800A 67 FUNC_REVERSE_SUBTRACT_OES 0x800B 68 69 Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, 70 and GetFloatv: 71 72 BLEND_EQUATION_OES 0x8009 73 74Additions to Chapter 2 of the OpenGL ES 1.1 Specification (OpenGL Operation) 75 76 None 77 78Additions to Chapter 3 of the OpenGL ES 1.1 Specification (Rasterization) 79 80 None 81 82Additions to Chapter 4 of the OpenGL ES 1.1 Specification (Per-Fragment Operations 83and the Framebuffer) 84 85 Replace the 1st paragraph of the "Blend Equation" discussion in section 86 4.1.7 (Blending) with the following: 87 88 "Blending is controlled by the blend equations, defined by the command 89 90 void BlendEquationOES(enum mode); 91 92 <mode> determines the blend equation. <mode> must be one of FUNC_ADD_OES, 93 FUNC_SUBTRACT_OES, or FUNC_REVERSE_SUBTRACT_OES." 94 95 Replace the last paragraph of the "Blend Equation" discussion in section 96 4.1.7 (Blending) with the following: 97 98 "Table 4.blendeq provides the corresponding per-component blend equations 99 for each mode. In the table, the s subscript on a color component 100 abbreviation (R, G, B, or A) refers to the source color component for an 101 incoming fragment and the d subscript on a color component abbreviation 102 refers to the destination color component at the corresponding framebuffer 103 location. A color component abbreviation without a subscript refers to the 104 new color component resulting from blending. Additionally, Sr, Sg, Sb, and 105 Sa are the red, green, blue, and alpha components of the source weighting 106 factors determined by the source blend function, and Dr, Dg , Db, and Da 107 are the red, green, blue, and alpha components of the destination weighting 108 factors determined by the destination blend function. Blend functions are 109 described below. 110 111 Mode Equation 112 ------------------------- --------------------- 113 FUNC_ADD_OES R = Rs * Sr + Rd * Dr 114 G = Gs * Sg + Gd * Dg 115 B = Bs * Sb + Bd * Db 116 A = As * Sa + Ad * Da 117 ------------------------- --------------------- 118 FUNC_SUBTRACT_OES R = Rs * Sr - Rd * Dr 119 G = Gs * Sg - Gd * Dg 120 B = Bs * Sb - Bd * Db 121 A = As * Sa - Ad * Da 122 ------------------------- --------------------- 123 FUNC_REVERSE_SUBTRACT_OES R = Rd * Dr - Rs * Sr 124 G = Gd * Dg - Gs * Sg 125 B = Bd * Db - Bs * Sb 126 A = Ad * Da - As * Sa 127 ------------------------- --------------------- 128 129 Table 4.blendeq: Blend equations." 130 131 In the "Blending State" paragraph, insert the following: 132 133 "The state required for blending is... one integer indicating the 134 blend equation... The initial blending equation is FUNC_ADD_OES." 135 136Additions to Chapter 5 of the OpenGL ES 1.1 Specification (Special Functions) 137 138 None 139 140Additions to Chapter 6 of the OpenGL ES 1.1 Specification (State and State Requests) 141 142 None 143 144Errors 145 146 INVALID_ENUM is generated by BlendEquationOES if its single parameter 147 is not FUNC_ADD_OES, FUNC_SUBTRACT_OES, or FUNC_REVERSE_SUBTRACT_OES. 148 149New State 150 151 Get Value Get Command Type Initial Value 152 --------- ----------- ---- ------------- 153 BLEND_EQUATION_OES GetIntegerv Z3 FUNC_ADD_OES 154 155New Implementation Dependent State 156 157 None 158 159Revision History 160 161 2009/05/19 Benj Lipchak First draft of true extension specification 162 163