1Name 2 3 EXT_blend_func_separate 4 5Name Strings 6 7 GL_EXT_blend_func_separate 8 9Version 10 11 Date: 04/06/1999 Version 1.3 12 13Number 14 15 173 16 17Dependencies 18 19 None 20 21Overview 22 23 Blending capability is extended by defining a function that allows 24 independent setting of the RGB and alpha blend factors for blend 25 operations that require source and destination blend factors. It 26 is not always desired that the blending used for RGB is also applied 27 to alpha. 28 29New Procedures and Functions 30 31 void BlendFuncSeparateEXT(enum sfactorRGB, 32 enum dfactorRGB, 33 enum sfactorAlpha, 34 enum dfactorAlpha); 35 36New Tokens 37 38 Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, 39 GetFloatv, and GetDoublev: 40 41 BLEND_DST_RGB_EXT 0x80C8 42 BLEND_SRC_RGB_EXT 0x80C9 43 BLEND_DST_ALPHA_EXT 0x80CA 44 BLEND_SRC_ALPHA_EXT 0x80CB 45 46 47Additions to Chapter 2 of the 1.2 GL Specification (OpenGL Operation) 48 49 None 50 51Additions to Chapter 3 of the 1.2 GL Specification (Rasterization) 52 53 None 54 55Additions to Chapter 4 of the 1.2 GL Specification (Per-Fragment Operations 56and the Framebuffer) 57 58 The RGB and alpha blend factors are separate. The function 59 BlendFuncSeparateEXT allows the specification of the four factors. 60 Table 4.1 and Table 4.2 are modified as follows: 61 62 Value RGB Factors Alpha Factors 63 ------------------ ---------------------------- ------------- 64 ZERO (0, 0, 0) 0 65 ONE (1, 1, 1) 1 66 DST_COLOR (Rd/Kr, Gd/Kg, Bd/Kb) Ad/Ka 67 ONE_MINUS_DST_COLOR (1-Rd/Kr, 1-Gd/Kg, 1-Bd/Kb) 1-Ad/Ka 68 SRC_ALPHA (As/Ka, As/Ka, As/Ka) As/Ka 69 ONE_MINUS_SRC_ALPHA (1-As/Ka, 1-As/Ka, 1-As/Ka) 1-As/Ka 70 DST_ALPHA (Ad/Ka, Ad/Ka, Ad/Ka) Ad/Ka 71 ONE_MINUS_DST_ALPHA (1-Ad/Ka, 1-Ad/Ka, 1-Ad/Ka) 1-Ad/Ka 72 CONSTANT_COLOR (Rc, Gc, Bc) Ac 73 ONE_MINUS_CONSTANT_COLOR (1-Rc, 1-Gc, 1-Bc) 1-Ac 74 CONSTANT_ALPHA (Ac, Ac, Ac) Ac 75 ONE_MINUS_CONSTANT_ALPHA (1-Ac, 1-Ac, 1-Ac) 1-Ac 76 SRC_ALPHA_SATURATE (f, f, f) 1 77 78 Value RGB Factors Alpha Factors 79 ------------------ ---------------------------- ------------- 80 ZERO (0, 0, 0) 0 81 ONE (1, 1, 1) 1 82 SRC_COLOR (Rs/Kr, Gs/Kg, Bs/Kb) As/Ka 83 ONE_MINUS_SRC_COLOR (1-Rs/Kr, 1-Gs/Kg, 1-Bs/Kb) 1-As/Ka 84 SRC_ALPHA (As/Ka, As/Ka, As/Ka) As/Ka 85 ONE_MINUS_SRC_ALPHA (1-As/Ka, 1-As/Ka, 1-As/Ka) 1-As/Ka 86 DST_ALPHA (Ad/Ka, Ad/Ka, Ad/Ka) Ad/Ka 87 ONE_MINUS_DST_ALPHA (1-Ad/Ka, 1-Ad/Ka, 1-Ad/Ka) 1-Ad/Ka 88 CONSTANT_COLOR (Rc, Gc, Bc) Ac 89 ONE_MINUS_CONSTANT_COLOR (1-Rc, 1-Gc, 1-Bc) 1-Ac 90 CONSTANT_ALPHA (Ac, Ac, Ac) Ac 91 ONE_MINUS_CONSTANT_ALPHA (1-Ac, 1-Ac, 1-Ac) 1-Ac 92 SRC_ALPHA_SATURATE (f, f, f) 1 93 94 The commands that control blending are 95 96 void BlendFunc(enum src, enum dst) 97 void BlendFuncSeparateEXT(enum sfactorRGB, enum dfactorRGB, 98 enum sfactorAlpha, enum dfactorAlpha); 99 100 The BlendFunc command sets both source factors (RGB and alpha) and 101 destination factors (RGB and alpha) while BlendFuncSeparateEXT sets 102 the RGB factors independently from the alpha factors. 103 104Additions to Chapter 5 of the 1.2 GL Specification (Special Functions) 105 106 None 107 108Additions to Chapter 6 of the 1.2 GL Specification (State and State Requests) 109 110 The state required is four integers indicating the source and 111 destination blending functions for RGB and alpha. The initial state 112 for both source functions is ONE. The initial state for both 113 destination functions is ZERO. 114 115Additions to the GLX Specification 116 117 None 118 119GLX Protocol 120 121 A new GL rendering command is added. The following command is sent 122 to the server as part of a glXRender request: 123 124 BlendFuncSeparateEXT 125 2 20 rendering command length 126 2 4134 rendering command opcode 127 4 ENUM sfactorRGB 128 4 ENUM dfactorRGB 129 4 ENUM sfactorAlpha 130 4 ENUM dfactorAlpha 131 132Errors 133 134 GL_INVALID_ENUM is generated if either sfactorRGB, dfactorRGB, 135 sfactorAlpha, or dfactorAlpha is not an accepted value. 136 137 GL_INVALID_OPERATION is generated if glBlendFunc is executed between 138 the execution of glBegin and the corresponding execution of glEnd. 139 140New State 141 142 The get values BLEND_SRC and BLEND_DST return the RGB source and 143 destination factor, respectively. 144 145 Initial 146 Get Value Get Command Type Value Attribute 147 --------- ----------- ---- ------- ------------ 148 BLEND_SRC_RGB_EXT GetFloatv Z ONE color-buffer 149 BLEND_DST_RGB_EXT GetFloatv Z ZERO color-buffer 150 BLEND_SRC_ALPHA_EXT GetFloatv Z ONE color-buffer 151 BLEND_DST_ALPHA_EXT GetFloatv Z ZERO color-buffer 152 153New Implementation Dependent State 154 155 None 156