1Name 2 3 SUN_global_alpha 4 5 6Name Strings 7 8 GL_SUN_global_alpha 9 10Contact 11 12 Jack Middleton, Sun (Jack.Middleton 'at' eng.sun.com) 13 14Status 15 16 Shipping 17 18Version 19 20 $Date: 1999/12/28 01:40:37 $ $Revision: 1.4 $ 21 SUN Date: 99/06/25 13:05:48 Revision: 1.7 22 23Number 24 25 164 26 27Dependencies 28 29 OpenGL 1.2 is required 30 31 32Overview 33 34 Transparency is done in OpenGL using alpha blending. An alpha value 35 of 0.0 is used for fully transparent objects, while an alpha value 36 of 1.0 is used for fully opaque objects. A value of 0.25 is 75% 37 transparent, and so on. 38 39 OpenGL defines alpha as a component of the vertex color state. 40 Whenever a color is set, the alpha component is set along with the 41 red, green, and blue components. This means that transparency 42 can't be changed for primitives with per-vertex colors without 43 modifying the color of each vertex, replacing the old alpha 44 component with the new alpha component. This can be very expensive 45 for objects that are drawn using vertex arrays; it all but 46 precludes the use of display lists. 47 48 This extension defines a new global alpha attribute that can be 49 used to specify an alpha factor that is independent from the alpha 50 component of the color value. The global alpha factor is 51 multiplied by the fragment's alpha value after primitive 52 rasterization and prior to texture mapping, replacing the 53 fragment's alpha value. The global alpha extension is only 54 specified in RGBA mode and must be applied prior to any texture 55 mapping operation. It is enabled by a new GLOBAL_ALPHA flag. 56 57 58New Procedures and Functions 59 60 void GlobalAlphaFactorbSUN(byte factor); 61 62 void GlobalAlphaFactorsSUN(short factor); 63 64 void GlobalAlphaFactoriSUN(int factor); 65 66 void GlobalAlphaFactorfSUN(float factor); 67 68 void GlobalAlphaFactordSUN(double factor); 69 70 void GlobalAlphaFactorubSUN(ubyte factor); 71 72 void GlobalAlphaFactorusSUN(ushort factor); 73 74 void GlobalAlphaFactoruiSUN(uint factor); 75 76 77New Tokens 78 79 Accepted by the <cap> parameter of Enable, Disable, and IsEnabled: 80 81 GLOBAL_ALPHA_SUN 0x81D9 82 83 Accepted by the by the <pname> parameter of GetBooleanv, 84 GetIntegerv, GetFloatv, and GetDoublev: 85 86 GLOBAL_ALPHA_FACTOR_SUN 0x81DA 87 88 89Additions to Chapter 2 of the GL Specification (OpenGL Operation) 90 91 None 92 93 94Additions to Chapter 3 of the GL Specification (Rasterization) 95 96 Global alpha processing is a new stage in the rasterization 97 pipeline that occurs after primitive rasterization (including 98 pixel rectangles and bitmaps) and before any texture mapping 99 operations. Global alpha processing is only done in RGBA mode. 100 It has no effect in color index mode. 101 102 Global alpha processing is enabled or disabled with the Enable and 103 Disable commands using the symbolic constant GLOBAL_ALPHA_SUN. 104 The global alpha factor is set using one of the GlobalAlphaFactor*SUN 105 commands listed above. 106 107 If global alpha processing is enabled, then the global alpha factor 108 is multiplied by the incoming fragment's alpha value. This 109 product replaces the fragment's alpha value and is passed to 110 subsequent stages in the pipeline. 111 112 Note that for geometric primitives, a functionally equivalent 113 method to that of performing a multiplication for each 114 fragment is to multiply the alpha values at each vertex of the 115 primitive by the global alpha factor prior to the primitive 116 rasterization step. 117 118 119Additions to Chapter 4 of the GL Specification (Per-Fragment Operations 120and the Framebuffer) 121 122 None 123 124 125Additions to Chapter 5 of the GL Specification (Special Functions) 126 127 None 128 129 130Additions to Chapter 6 of the GL Specification (State and State Requests) 131 132 None 133 134 135Additions to the GLX / WGL / AGL Specifications 136 137 138 None 139 140 141GLX Protocol 142 143 Eight rendering commands are sent to the server as part of 144 the glXRender request: 145 146 GlobalAlphaFactorbSUN 147 2 8 rendering command length 148 2 16391 rendering command opcode 149 1 INT8 code 150 1 INT8 pad 151 2 INT16 pad 152 153 GlobalAlphaFactorsSUN 154 2 8 rendering command length 155 2 16392 rendering command opcode 156 2 INT16 code 157 2 INT16 pad 158 159 GlobalAlphaFactoriSUN 160 2 8 rendering command length 161 2 16393 rendering command opcode 162 4 INT32 code 163 164 GlobalAlphaFactorfSUN 165 2 8 rendering command length 166 2 16394 rendering command opcode 167 4 FLOAT32 code 168 169 GlobalAlphaFactordSUN 170 2 12 rendering command length 171 2 16395 rendering command opcode 172 8 FLOAT64 code 173 174 GlobalAlphaFactorubSUN 175 2 8 rendering command length 176 2 16396 rendering command opcode 177 1 CARD8 code 178 1 CARD8 pad 179 2 CARD16 pad 180 181 GlobalAlphaFactorusSUN 182 2 8 rendering command length 183 2 16397 rendering command opcode 184 2 CARD16 code 185 2 CARD16 pad 186 187 GlobalAlphaFactoruiSUN 188 2 8 rendering command length 189 2 16398 rendering command opcode 190 4 CARD32 code 191 192 193Errors 194 195 None 196 197 198New State 199 200 Get Value Get Command Type Initial Value 201 --------- ----------- ---- ------------- 202 GLOBAL_ALPHA_FACTOR_SUN GetIntegerv, C 1 203 GetFloatv 204 GLOBAL_ALPHA_SUN IsEnabled B False 205 206 Get Value Attribute 207 --------- --------- 208 GLOBAL_ALPHA_FACTOR_SUN color-buffer 209 GLOBAL_ALPHA_SUN color-buffer/enable 210 211 212Revision History 213 214 6/25/99 Added fields from the new extension template. 215