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